Error with 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 ) ); ... }
It works great
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 that my DbGeography did not DbGeography ref this time.
Any reasons why the .OrderBy( x => x.GeoLocation.Distance( geo ) ); function .OrderBy( x => x.GeoLocation.Distance( geo ) ); would produce the following error:
Cannot convert lambda expression to type 'string' because it is not a delegate type
source share