public void EditRegion(RegionModel model) { if (ModelState.IsValid) { var region = RegionModel.ToDomainModel(model); if (region.Id > 0) { masterService.UpdateRegion(region); } else { masterService.AddRegions(new[] { region }); } } //return RedirectToAction("Regions"); }
public static Region ToDomainModel(RegionModel model) { return new Region { Id = model.Id, Name = model.Name, Description = model.Description }; }