//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); }
//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)); }