public IActionResult AddLocation(Location location) { try { _locationServices.AddLocation(location); return(CreatedAtAction("AddLocation", location)); } catch (Exception) { return(BadRequest()); } }
protected async Task HandleValidSubmit() { Mapper.Map(EditLocationModel, Location); Location result = null; if (Location.id != 0) { result = await LocationServices.UpdateLocation(Location); } else { result = await LocationServices.AddLocation(Location); } if (result != null) { Navigation.NavigateTo("/Libraries"); } }