public IActionResult GetAllLocations() { try { return(Ok(_mapper.ParseLocation(_locationService.GetAllLocations()))); } catch (Exception) { return(BadRequest()); } }
public Model.Location AddLocation(Model.Location newLocation) { _context.Locations.Add(_mapper.ParseLocation(newLocation)); _context.SaveChanges(); return(newLocation); }