public bool Delete(Nt_Grp_Cant item, Session session = null) { //LoggerFactory.CreateLog().Start(); var committed = 0; try { //if (session != null) // _repositoryNt_Grp_Cant.UnitOfWork.SetConnectionDb(session.ConnectionString); if (item == null) { throw new ArgumentNullException("item"); } // Domain Services? //_repositoryNt_Grp_Cant.Delete(Mapper.Map<Dominio.Entidades.Nt_Grp_Cant>(item)); _repositoryNt_Grp_Cant.Delete(item); committed = _unitOfWorkAsync.SaveChanges(); } catch (Exception ex) { //LoggerFactory.CreateLog().Error(ex); } //LoggerFactory.CreateLog().Stop(); return(committed > 0); }
public bool Update(Nt_Grp_Cant item, Session session = null) { //LoggerFactory.CreateLog().Start(); var committed = 0; try { //if (session != null) // _repositoryNt_Grp_Cant.UnitOfWork.SetConnectionDb(session.ConnectionString); if (item == null) { throw new ArgumentNullException("item"); } var validator = EntityValidatorFactory.CreateValidator(); if (validator.IsValid(item)) { // Domain Services? //_repositoryNt_Grp_Cant.Update(Mapper.Map<Dominio.Entidades.Nt_Grp_Cant>(item)); _repositoryNt_Grp_Cant.Update(item); committed = _unitOfWorkAsync.SaveChanges(); } else { throw new ApplicationValidationErrorsException(validator.GetInvalidMessages(item)); } } catch (Exception ex) { //LoggerFactory.CreateLog().Error(ex); } //LoggerFactory.CreateLog().Stop(); //_repositoryNt_Grp_Cant.Update(entity); return(committed > 0); }
public Nt_Grp_CantCrudViewModel() { Nt_Grp_Cant = new Nt_Grp_Cant(); }
public void ApplyChanges(Nt_Grp_Cant entity) { _repositoryNt_Grp_Cant.ApplyChanges(entity); }