This fails with an error:
private IQueryable<Field> PrepareAllFieldsQuery( ref DbGeography geo, int page, int amount, string sort, string order, ISearchCriteria searchCriteria )
{
var query = this.context.Fields
.Where( x => x.DeletedAt == null )
.OrderBy( x => x.GeoLocation.Distance( geo ) );
...
}
This runs fine
private IQueryable<Field> PrepareAllFieldsQuery( DbGeography geo, int page, int amount, string sort, string order, ISearchCriteria searchCriteria )
{
var query = this.context.Fields
.Where( x => x.DeletedAt == null )
.OrderBy( x => x.GeoLocation.Distance( geo ) );
...
}
The difference is my DbGeography
is not passed by ref this time.
Any reasons why the .OrderBy( x => x.GeoLocation.Distance( geo ) );
function would throw the following error:
Cannot convert lambda expression to type 'string' because it is not a delegate type