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