FindBy Id method in EntityFramework
问题 it is possible to implement FindBy method in Entity framework while we have this GenericRepository class : public class Repository<T> : IRepository<T> where T : class, IAggregateRoot { private readonly DbSet<T> _entitySet; public IQueryable<T> FindBy(Expression<Func<T, bool>> predicate) { //IQueryable<T> query=_entitySet. } } how can I Implement FindBy in this case !?? 回答1: My Repository has the following method to return a single entity by a given expression. public T FindSingle(Expression