public virtual IQueryable <E> FindBy(Expression <Func <E, bool> > predicate, string[] includeProperties = null) { IQueryable <E> query = Context.Set <E>(); if (includeProperties != null) { foreach (string includeProperty in includeProperties) { query = query.Include(includeProperty); } } return(query.Where(predicate)); }
public virtual void Add(E entity) { Context.Set <E>().Add(entity); Context.SaveChanges(); }