1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-11 15:52:25 -05:00

Stats thread safe

Cleaned up WebService class and shutdown
reimped stats and topstats
moved things out of stats into main code
This commit is contained in:
RaidMax
2018-02-10 00:26:38 -06:00
parent 293d439760
commit d1cdb93cc3
31 changed files with 668 additions and 927 deletions

View File

@ -41,11 +41,17 @@ namespace SharedLibrary.Services
}
}
public virtual async Task<IList<TEntity>> FindAsync(Expression<Func<TEntity, bool>> predicate, Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderExpression = null)
{
return await this.GetQuery(predicate, orderExpression).ToListAsync();
}
public virtual IEnumerable<TEntity> Find(Expression<Func<TEntity, bool>> predicate, Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderExpression = null)
{
return this.GetQuery(predicate, orderExpression).AsEnumerable();
}
public virtual IQueryable<TEntity> GetQuery(Expression<Func<TEntity, bool>> predicate = null, Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderExpression = null)
{
IQueryable<TEntity> qry = this.DBSet;
@ -131,16 +137,10 @@ namespace SharedLibrary.Services
this.Context.SaveChanges();
}
public virtual async Task SaveChangesAsync()
public virtual Task SaveChangesAsync()
{
try
{
await this.Context.SaveChangesAsync();
}
catch (Exception e)
{
throw e;
}
return this.Context.SaveChangesAsync();
}
}
}