mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-12 16:18:07 -05:00
renable weapon name in anticheat snapshot list
update migrations for unique index fix missing total connection time include total connection time in get client query
This commit is contained in:
@ -10,6 +10,8 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SharedLibraryCore.Database
|
||||
{
|
||||
@ -69,8 +71,8 @@ namespace SharedLibraryCore.Database
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
// optionsBuilder.UseLoggerFactory(_loggerFactory)
|
||||
// .EnableSensitiveDataLogging();
|
||||
// optionsBuilder.UseLoggerFactory(_loggerFactory)
|
||||
// .EnableSensitiveDataLogging();
|
||||
|
||||
if (string.IsNullOrEmpty(_ConnectionString))
|
||||
{
|
||||
@ -102,6 +104,41 @@ namespace SharedLibraryCore.Database
|
||||
}
|
||||
}
|
||||
|
||||
private void SetAuditColumns()
|
||||
{
|
||||
return;
|
||||
var entries = ChangeTracker
|
||||
.Entries()
|
||||
.Where(e => e.Entity is SharedEntity && (
|
||||
e.State == EntityState.Added
|
||||
|| e.State == EntityState.Modified)).ToList();
|
||||
|
||||
foreach (var entityEntry in entries)
|
||||
{
|
||||
if (entityEntry.State == EntityState.Added)
|
||||
{
|
||||
//((SharedEntity)entityEntry.Entity).CreatedDateTime = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//((SharedEntity)entityEntry.Entity).UpdatedDateTime = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default)
|
||||
{
|
||||
SetAuditColumns();
|
||||
return base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken);
|
||||
}
|
||||
|
||||
public override int SaveChanges()
|
||||
{
|
||||
SetAuditColumns();
|
||||
return base.SaveChanges();
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
// make network id unique
|
||||
|
Reference in New Issue
Block a user