예제 #1
0
        //public virtual async Task<IEnumerable<T>> FindByAsync(Expression<Func<T, bool>> predicate)
        //{
        //    return await _context.Set<T>().Where(predicate).ToListAsync();
        //}

        public virtual void Add(T entity)
        {
            EntityEntry dbEntityEntry = _context.Entry <T>(entity);

            _context.Set <T>().Add(entity);
        }
예제 #2
0
        //public virtual async Task<IEnumerable<T>> FindByAsync(Expression<Func<T, bool>> predicate)
        //{
        //    return await _context.Set<T>().Where(predicate).ToListAsync();
        //}

        public virtual EntityEntry <T> Add(T entity)
        {
            EntityEntry dbEntityEntry = _context.Entry <T>(entity);

            return(_context.Set <T>().Add(entity));
        }