public void Atualizar(object entidade) { var type = entidade.GetType(); var id = type.GetProperty("Id").GetValue(entidade); if (Repository.ObterPorId(type, id) == null) { return; } var ehValido = Convert.ToBoolean(ChamadorMetodo.ChamarMetodo(entidade, "EhValido")); if (ehValido) { Repository.Atualizar(entidade); } }
public void DeepUpdate(Type type, object entity) { ChamadorMetodo.ChamarMetodoGenerico(this, GetCurrentMethod(), new Type[] { type }, entity); }
public IEnumerable <object> GetActives(Type type) { return(ChamadorMetodo.ChamarMetodoGenerico(this, GetCurrentMethod(), new Type[] { type }) as IEnumerable <object>); }
public object GetSingle(Type type, object id) { return(ChamadorMetodo.ChamarMetodoGenerico(this, GetCurrentMethod(), new Type[] { type }, id)); }
public void Delete(Type type, object id) { ChamadorMetodo.ChamarMetodoGenerico(this, GetCurrentMethod(), new Type[] { type }, id); }
public IEnumerable <object> ObterTodosAtivos(Type type) { return(ChamadorMetodo.ChamarMetodoGenerico(this, "ObterTodosAtivos", new Type[] { type }) as IEnumerable <object>); }
public object ObterPorId(Type type, object id) { return(ChamadorMetodo.ChamarMetodoGenerico(this, "ObterPorId", new Type[] { type }, id)); }