public IEnumerable <TEntity> getAll(string include = null)
 {
     if (string.IsNullOrEmpty(include))
     {
         return(ctx.Set <TEntity>().ToList());
     }
     else
     {
         return(ctx.Set <TEntity>().Include(include).ToList());
     }
 }
 public void Add(TEntity obj)
 {
     Db.Set <TEntity>().Add(obj);
     Db.SaveChanges();
 }
示例#3
0
 public GenericRepository(Context.Context context)
 {
     _context = context;
     _dbSet   = context.Set <TEntity>();
 }
示例#4
0
 public GenericRepository(Context.Context context)
 {
     this.context = context;
     entity_      = context.Set <T>();
 }
示例#5
0
 protected BaseRepository(Context.Context context)
 {
     _context = context;
     _dbSet   = _context.Set <TEntity>();
 }
示例#6
0
 public BaseRepository(Context.Context context)
 {
     Db    = context;
     DbSet = context.Set <T>();
 }
        /// <summary>
        /// Método de busca de endereços
        /// </summary>
        /// <param name="personKey">Chave da pessoa</param>
        /// <returns>Listagem de endereços.</returns>
        public async Task <IEnumerable <Address> > Get(Guid personKey)
        {
            var addresses = await _context.Set <Address>().ToListAsync();

            return(addresses.Where(a => a.PersonKey == personKey));
        }
 public BaseRepository(Context.Context context) : base(context)
 {
     Contexto = context;
     DbSet    = Contexto.Set <T>();
 }
示例#9
0
 public virtual IQueryable <TEntity> GetAll()
 {
     return(ctx.Set <TEntity>());
 }
示例#10
0
 public Repository(Context.Context context)
 {
     Db    = context;
     DbSet = Db.Set <TEntity>();
 }
示例#11
0
 public ReadOnlyBaseRepository(Context.Context context) : base(context)
 {
     Context = context;
     DbSet   = Context.Set <T>();
 }
 public CrudRepository(Context.Context context)
 {
     _context = context;
     _dbSet   = context.Set <TEntity>();
 }
示例#13
0
 public UserRepository(Context.Context context)
 {
     _db     = context;
     _models = _db.Set <UserDomainModel>();
 }
示例#14
0
 public BaseRepository(Context.Context context)
 {
     _context = context;
     _dataSet = _context.Set <T>();
 }
 public BaseRepository(Context.Context context)
 {
     this.context = context;
     _entity      = context.Set <T>();
 }
 public ContaPagarRepository(Context.Context context) : base(context)
 {
     _dataset = context.Set <ContaPagarEntity>();
 }
示例#17
0
 /// <summary>
 /// Método de listagem de pessoas.
 /// </summary>
 /// <returns>Listagem de pessoas.</returns>
 public async Task <IEnumerable <Person> > Get()
 {
     return(await _context.Set <Person>().ToListAsync());
 }