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:
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user