public async Task <int> SuaDanhBa(DanhBaBO danhBa) { var result = 0; var config = new MapperConfiguration(cfg => { cfg.CreateMap <DanhBaBO, DanhBaDO>(); }); var mapper = config.CreateMapper(); var addParam = mapper.Map <DanhBaDO>(danhBa); using (DalSession dal = new DalSession()) { try { dal.UnitOfWork.Begin(); result = await dal.UnitOfWork.DanhBaRepository.SuaDanhBa(addParam); dal.UnitOfWork.Commit(); } catch (Exception ex) { dal.UnitOfWork.Rollback(); } return(result); } }
public async Task <ActionResult <int> > SuaDanhBa(DanhBaBO request) { return(await _danhBaService.SuaDanhBa(request)); }