Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

wpf repository pattern query async with includes properties

public T Get(int id, params Expression<Func<T, object>>[] includes)
{
    IQueryable<T> query = _context.Set<T>();
    if (includes != null)
        foreach (Expression<Func<T, object>> include in includes)
            query = query.Include(include);

    return ((DbSet<T>)query).Find(id);
}
Source by entityframework.net #
 
PREVIOUS NEXT
Tagged: #wpf #repository #pattern #query #async #includes #properties
ADD COMMENT
Topic
Name
2+1 =