Example #1
0
        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);
            }
        }
Example #2
0
 public void DeepUpdate(Type type, object entity)
 {
     ChamadorMetodo.ChamarMetodoGenerico(this, GetCurrentMethod(), new Type[] { type }, entity);
 }
Example #3
0
 public IEnumerable <object> GetActives(Type type)
 {
     return(ChamadorMetodo.ChamarMetodoGenerico(this, GetCurrentMethod(), new Type[] { type }) as IEnumerable <object>);
 }
Example #4
0
 public object GetSingle(Type type, object id)
 {
     return(ChamadorMetodo.ChamarMetodoGenerico(this, GetCurrentMethod(), new Type[] { type }, id));
 }
Example #5
0
 public void Delete(Type type, object id)
 {
     ChamadorMetodo.ChamarMetodoGenerico(this, GetCurrentMethod(), new Type[] { type }, id);
 }
Example #6
0
 public IEnumerable <object> ObterTodosAtivos(Type type)
 {
     return(ChamadorMetodo.ChamarMetodoGenerico(this, "ObterTodosAtivos", new Type[] { type }) as IEnumerable <object>);
 }
Example #7
0
 public object ObterPorId(Type type, object id)
 {
     return(ChamadorMetodo.ChamarMetodoGenerico(this, "ObterPorId", new Type[] { type }, id));
 }