Exemplo n.º 1
0
 public virtual TEntity Single(Expression <Func <TEntity, bool> > predicate)
 {
     return(SelectedSetWithIncludes.SingleOrDefault(predicate));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Get entity by Id
 /// </summary>
 /// <param name="id">Identify key of entity</param>
 /// <returns>TEntity</returns>
 public virtual TEntity GetById(int id)
 {
     return(SelectedSetWithIncludes.SingleOrDefault(x => x.Id == id));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Get list entity which condition
 /// </summary>
 /// <param name="predicate">Condition</param>
 /// <returns>List entity</returns>
 public virtual IList <TEntity> Get(Expression <Func <TEntity, bool> > predicate)
 {
     return(SelectedSetWithIncludes.Where(predicate).ToList());
 }
Exemplo n.º 4
0
 /// <summary>
 /// The get.
 /// </summary>
 /// <param name="id">
 /// The id.
 /// </param>
 /// <returns>
 /// The <see cref="T"/>.
 /// </returns>
 public virtual T Get(TId id)
 {
     return(SelectedSetWithIncludes.AsEnumerable().Single(entity => id.Equals(entity.Id)));
 }