public async Task <bool> Add(AuditTypeDto model) { string auditTypeId = await GetAuditTypeID(); model.Audit_Type_ID = auditTypeId; var auditType = _mapper.Map <MES_Audit_Type_M>(model); _repoAuditType.Add(auditType); return(await _repoAuditType.SaveAll()); }
public async Task <bool> Add(AuditTypeDto model) { var auditType = _mapper.Map <MES_Audit_Type_M>(model); _repoAuditType.Add(auditType); return(await _repoAuditType.SaveAll()); }
public AuditTypeOutput Execute(AuditType auditType) { var tp = _auditTypeRepository.CheckDuplicated(auditType); if (tp == null) { return(_mapper.Map <AuditType, AuditTypeOutput>(_auditTypeRepository.Add(auditType))); } else { throw new DuplicateEntityException(auditType.Name, "Ya existe un tipo de auditoria con este nombre y/o código"); } }