1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-11 07:40:54 -05:00

added 'none' and extra m16 variants to weapon list

moved killstreak/deathstreak messages into configuration file
cleaned up configuration manager
fixed misc startup issue and threading
added more importing stuff
network id is a ulong now
ip str is now ip
added time played (per server)
This commit is contained in:
RaidMax
2018-02-10 22:33:42 -06:00
parent d1cdb93cc3
commit b8a161161d
33 changed files with 418 additions and 213 deletions

View File

@ -73,7 +73,7 @@ namespace SharedLibrary.Services
.SingleOrDefaultAsync(e => e.AliasId == entityID);
}
public Task<EFAlias> GetUnique(string entityProperty)
public Task<EFAlias> GetUnique(long entityProperty)
{
throw new NotImplementedException();
}

View File

@ -102,14 +102,18 @@ namespace SharedLibrary.Services
public async Task<EFClient> Get(int entityID)
{
using (var context = new DatabaseContext())
{
context.Configuration.LazyLoadingEnabled = false;
context.Configuration.ProxyCreationEnabled = false;
return await new DatabaseContext().Clients
.AsNoTracking()
.Include(c => c.CurrentAlias)
.Include(c => c.AliasLink.Children)
.SingleOrDefaultAsync(e => e.ClientId == entityID);
}
}
public async Task<EFClient> GetUnique(string entityAttribute)
public async Task<EFClient> GetUnique(long entityAttribute)
{
using (var context = new DatabaseContext())
{
@ -117,7 +121,7 @@ namespace SharedLibrary.Services
.AsNoTracking()
.Include(c => c.CurrentAlias)
.Include(c => c.AliasLink.Children)
.SingleOrDefaultAsync(c => c.NetworkId == entityAttribute);
.SingleOrDefaultAsync(c => c.NetworkId == (long)entityAttribute);
}
}

View File

@ -1,68 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharedLibrary.Database;
namespace SharedLibrary.Services
{
public class GenericService<T> : Interfaces.IEntityService<T>
{
public async Task<T> Create(T entity)
{
using (var context = new DatabaseContext())
{
var dbSet = context.Set(entity.GetType());
T addedEntity = (T)dbSet.Add(entity);
await context.SaveChangesAsync();
return addedEntity;
}
}
public Task<T> CreateProxy()
{
throw new NotImplementedException();
}
public Task<T> Delete(T entity)
{
throw new NotImplementedException();
}
public Task<IList<T>> Find(Func<T, bool> expression)
{
throw new NotImplementedException();
}
public async Task<T> Get(int entityID)
{
using (var context = new DatabaseContext())
{
var dbSet = context.Set(typeof(T));
return (T)(await dbSet.FindAsync(entityID));
}
}
public async Task<T> Get(params object[] entityKeys)
{
using (var context = new DatabaseContext())
{
var dbSet = context.Set(typeof(T));
return (T)(await dbSet.FindAsync(entityKeys));
}
}
public Task<T> GetUnique(string entityProperty)
{
throw new NotImplementedException();
}
public Task<T> Update(T entity)
{
throw new NotImplementedException();
}
}
}

View File

@ -73,7 +73,7 @@ namespace SharedLibrary.Services
throw new NotImplementedException();
}
public Task<EFPenalty> GetUnique(string entityProperty)
public Task<EFPenalty> GetUnique(long entityProperty)
{
throw new NotImplementedException();
}