public ActionResult Create(LocationCRVM newLocation) { if (ModelState.IsValid) { try { _storeBL.AddLocation(_mapper.cast2Location(newLocation)); return(RedirectToAction(nameof(Index))); } catch { return(View()); } } return(View()); }
public ActionResult Create(LocationCRVM newLocation) { if (ModelState.IsValid) { try { _partsBL.AddLocation(_mapper.cast2Location(newLocation)); Log.Information($"Creation of new location"); return(RedirectToAction(nameof(Index))); } catch { Log.Warning("Unable to create new Location"); return(View()); } } else { return(View()); } }