public void UpdateDM_CanhBao(CreateOrEditDM_CanhBao input) { //We can use Logger, it's defined in ApplicationService base class. //Logger.Info("Update Nhom VatTu " + input); //Retrieving a task entity with given id using standard Get method of repositories. var item = _repository.Get(input.Id); ObjectMapper.Map(input, item); //Not Use Auto Mapper //item.MA_LOAITHUOC = input.MA_LOAITHUOC; //item.MOTA = input.MOTA; //item.TENNHOM = input.TENNHOM; //We even do not call Update method of the repository. //Because an application service method is a 'unit of work' scope as default. //ABP automatically saves all changes when a 'unit of work' scope ends (without any exception). }
public void CreateDM_CanhBao(CreateOrEditDM_CanhBao input) { //We can use Logger, it's defined in ApplicationService class. //Logger.Info("Creating a nhom vattu for input: " + input); //Creating a new Task entity with given input's properties var item = ObjectMapper.Map <DM_CanhBao>(input); //Not use AutoMapper //DM_CanhBao nhomVatTu = new DM_CanhBao() //{ // TENNHOM = input.TENNHOM, // MA_LOAITHUOC = input.MA_LOAITHUOC, // MOTA = input.MOTA //}; //Saving entity with standard Insert method of repositories. _repository.Insert(item); }