private static MapRequest CreateMapRequest(MapRequestAVM mapRequestAVM) { var mapRequest = new MapRequest(mapRequestAVM.Email, mapRequestAVM.Latitude.Value, mapRequestAVM.Longitude.Value,DateTime.Now); using (MediatelModel context = new MediatelModel()) { context.MapRequests.Add(mapRequest); context.SaveChanges(); } return mapRequest; }
public static MapSearchResultVM SearchForAddress(MapRequestAVM mapRequestAVM) { Validator.ValidateObject(mapRequestAVM, new ValidationContext(mapRequestAVM), true); MapRequest mapRequest = CreateMapRequest(mapRequestAVM); return SearchForAddress(mapRequest); }