public ExportAssetDto CreateExportAsset(ExportAssetDto input) { ExportAsset exportAsset = ObjectMapper.Map <ExportAsset>(input); SetAuditInsert(exportAsset); _ = repository.Insert(exportAsset); CurrentUnitOfWork.SaveChanges(); return(input); }
public ExportAssetDto UpdateExportAsset(ExportAssetDto input) { ExportAsset exportAsset = repository .GetAll() .Where(item => !item.IsDelete) .SingleOrDefault(item => item.Id == input.Id); if (exportAsset is null) { return(null); } else { ObjectMapper.Map(input, exportAsset); SetAuditEdit(exportAsset); exportAsset = repository.Update(exportAsset); CurrentUnitOfWork.SaveChanges(); return(ObjectMapper.Map <ExportAssetDto>(exportAsset)); } }
public ExportAssetDto UpdateExportAsset([FromBody] ExportAssetDto input) { return(appService.UpdateExportAsset(input)); }