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