URF.NET icon indicating copy to clipboard operation
URF.NET copied to clipboard

Add LoadProperty method to IRepository, IRepositoryAsync

Open tonysneed opened this issue 8 years ago • 0 comments

This will load a reference property.

IRepository:

void LoadProperty(TEntity item, Expression<Func<TEntity, object>> property);

IRepositoryAsync:

Task LoadProperty(TEntity item, Expression<Func<TEntity, object>> property);

Repository (.NET Core implementation -- will be different for EF 6.x):

public void LoadProperty(PlexApp item, Expression<Func<PlexApp, object>> property) => _context.Entry(item).Reference(property).Load();

public async Task LoadProperty(PlexApp item, Expression<Func<PlexApp, object>> property) => await _context.Entry(item).Reference(property).LoadAsync();

tonysneed avatar Dec 24 '17 12:12 tonysneed