public async Task <int> CreateDistrictAsync(DistrictModelRq model, UserIdentity <int> issuer) { try { var district = _mapper.Map <District>(model); district.CreateBy(issuer).UpdateBy(issuer); _districtRepository.Create(district); if (await _uow.SaveChangesAsync() == 1) { return(district.Id); } return(0); } catch (Exception e) { throw e; } }
public ActionResult Create(District district) { try { _districtRep.Create(district); _districtRep.Save(); return(RedirectToAction("Index")); } catch { return(View()); } }