Esempio n. 1
0
 public ServiceResult Creat <T>(T entity) where T : Entity
 {
     if (entity == null)
     {
         throw new ArgumentNullException("entity");
     }
     _ctx.Set <T>().Add(entity);
     _ctx.SaveChanges();
     return(new ServiceResult(true).Set(entity));
 }
Esempio n. 2
0
 public IQueryable <T> Query <T>() where T : Entity
 {
     return(Ctx.Set <T>().AsQueryable());
 }