I try to execute the following query:
dbContext.Datas.FromSqlRaw($"select LD.\"Id\", LD.\"OId\" from public.\"Datas\" LD where ST_Intersects(LD.\"Geometry\", st_geomfromtext('POINT({lat} {lng})'))").Select(l => l.Id);
But whenever I'm doing it, I get the following error:
""POINT(-1741541,25" <-- parse error at position 17 within geometry" Obviously, it changes -1741541.25 to -1741541,25, and it's somehow linked with locale settings. However, my database locale is en-US, therefore it's not database's problem, but I should somehow configure my Entity framework, but I'm not sure how to do it and couldn't find it either. What should I do?
UPD: lat and lng are of type double (e.g -1741541.255287818)
I've also tried to do that using FromSqlInterpolated
dbContext.Datas.FromSqlInterpolated($"select LD.\"Id\", LD.\"OId\" from public.\"Datas\" LD where ST_Intersects(LD.\"Geometry\", st_geomfromtext('POINT({lat} {lng})'))").Select(l => l.Id);
But I get this error:
""POINT(@p" <-- parse error at position 8 within geometry"
Also I'm pretty much sure that my query is correct. Whenever I pass those lat and lng values into the query string, it works fine.