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)); }
public IQueryable <T> Query <T>() where T : Entity { return(Ctx.Set <T>().AsQueryable()); }