mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-11 07:40:54 -05:00
Add libraries for EntityFramework
Stats plugin work Allow plugins to dynamically add EF classes to the context
This commit is contained in:
@ -56,15 +56,16 @@ namespace SharedLibrary.Services
|
||||
|
||||
public async Task<IList<EFPenalty>> Find(Func<EFPenalty, bool> expression)
|
||||
{
|
||||
using (var context = new DatabaseContext())
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
return await Task.Run(() => context.Penalties
|
||||
.Include(p => p.Offender)
|
||||
.Include(p => p.Punisher)
|
||||
.Where(expression)
|
||||
.Where(p => p.Active)
|
||||
.ToList());
|
||||
}
|
||||
using (var context = new DatabaseContext())
|
||||
return context.Penalties
|
||||
.Include(p => p.Offender)
|
||||
.Include(p => p.Punisher)
|
||||
.Where(expression)
|
||||
.Where(p => p.Active)
|
||||
.ToList();
|
||||
});
|
||||
}
|
||||
|
||||
public Task<EFPenalty> Get(int entityID)
|
||||
|
Reference in New Issue
Block a user