1
0
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:
RaidMax
2018-02-06 23:19:06 -06:00
parent 8ce8db5f30
commit 0b62cba52a
81 changed files with 113748 additions and 802 deletions

View File

@ -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)