public async Task <IResponseService> Add(Catalog entity) { try { _repository.Add(entity); await _unit.Commit(); _responseService.EstablecerRespuesta(true); _unit.Dispose(); return(_responseService); } catch (Exception ex) { _responseService.Errores.Add(_exceptionHandler.GetMessage(ex)); return(_responseService); } }
public async Task <IResponseService> Add(User entity) { try { entity.BirthDate = GenericUtils.GetDateZone(entity.BirthDate); _repository.Add(entity); await _unit.Commit(); _responseService.EstablecerRespuesta(true); _unit.Dispose(); return(_responseService); } catch (Exception ex) { _responseService.Errores.Add(_exceptionHandler.GetMessage(ex)); return(_responseService); } }