public List <GlobalEvent> SearchByRadius(GlobalEventSearchRadiusRequest model) { List <GlobalEvent> list = null; DataProvider.ExecuteCmd(GetConnection, "dbo.GlobalEvent_SearchRadius" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@userLat", model.Lat); paramCollection.AddWithValue("@userLng", model.Lng); paramCollection.AddWithValue("@radius", model.Radius); } , map : delegate(IDataReader reader, short set) { switch (set) { case 0: GlobalEvent globalEvent = MapGlobalEvent(reader); if (list == null) { list = new List <GlobalEvent>(); } list.Add(globalEvent); break; } } ); return(list); }
public HttpResponseMessage SearchByRadius([FromUri] GlobalEventSearchRadiusRequest model) { ItemsResponse <GlobalEvent> response = new ItemsResponse <GlobalEvent>(); response.Items = _globalEventService.SearchByRadius(model); return(Request.CreateResponse(HttpStatusCode.OK, response)); }