public async Task <object> NearAsync(NearRequest request) { BO2 bo2 = await this.GetBOAsync(request.BOT, request.BO); if (bo2 == null) { return(null); } FilterRequest filterRequest = new FilterRequest(); filterRequest.Query = JObject.Parse($"{{bot:'{bo2.BOT}',bo:{{$ne:'{request.BO}'}},location:{{$near:{{$geometry:{bo2.Location.ToJson()},$maxDistance:{request.Distince}}}}}}}"); filterRequest.Fields = JObject.Parse("{bo:1}"); filterRequest.Limit = request.Top; List <BO2> nearestBOList = await this.FilterBOsAsync(filterRequest); return((nearestBOList == null || nearestBOList.Count == 0) ? null : nearestBOList.Select(bo => bo.BO).ToList()); }
public async Task <object> Near(NearRequest request) { return(await ServiceImpl.NearAsync(request)); }
public async Task <object> NearAsyncInternal(HttpClientWrapper client, NearRequest request) { return(await client.PostObjectAsync(GetActionUrl(nameof(Near)), request).ConfigureAwait(false)); }
public async Task <object> NearAsync(NearRequest request) { var client = InitHttpClient(); return(await NearAsyncInternal(client, request).ConfigureAwait(false)); }
public object Near(NearRequest request) { var client = InitHttpClient(); return(Task.Run(() => NearAsyncInternal(client, request)).Result); }
public List <T> Near <T>(NearRequest request) { var list = Near(request); return(ToGenericList <T>(list)); }
public List <Document> Near(NearRequest request) { var list = _protocol.Near(request); return(list.Cast <Document>().ToList()); }
public object Near(NearRequest request) { return(Task.Run(() => NearAsync(request)).Result); }