Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
public IList<Location> NearbyLocations(decimal latitude, decimal longitude, int distance, int excludeLocationId)
var criteria = Session.CreateSQLQuery("exec NearbyLocations @Latitude=:latitude, @Longitude=:longitude, @Distance=:distance, @ExcludeId=:excludeid");
criteria.SetDecimal("latitude", latitude);
criteria.SetDecimal("longitude", longitude);
criteria.SetInt32("distance", distance);
criteria.SetInt32("excludeid", excludeLocationId);
criteria.AddEntity(typeof (Location));
var results = criteria.List<Location>().ToList();
return results;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment