I am trying to issue a SQL update statement with nHibernate (2.0.1GA) like this:
sqlstring = string.Format(\"set nocount on;update myusers set geo=geography:
Following on @Chris's answer, here is a copy and paste solution:
CREATE FUNCTION GetPoint
(
@lat float,
@lng float,
@srid int
)
RETURNS geography
AS
BEGIN
declare @point geography = geography::Point(@lat, @lng, @srid);
RETURN @point
END
GO
The you do
dbo.GetPoint(@Latitude, @Longitude, 4326)
instead of
geography::Point(@Latitude, @Longitude, 4326);
And NH is happy