DocSpace-buildtools/common/ASC.Core.Common/EF/Context/AuditTrailContext.cs

40 lines
1.3 KiB
C#
Raw Normal View History

namespace ASC.Core.Common.EF.Context
2021-08-03 14:11:53 +00:00
{
public class MySqlAuditTrailContext : AuditTrailContext { }
public class PostgreSqlAuditTrailContext : AuditTrailContext { }
2020-10-06 07:06:05 +00:00
public class AuditTrailContext : BaseDbContext
{
2022-02-04 09:15:54 +00:00
public DbSet<DbAuditEvent> AuditEvents { get; set; }
public DbSet<User> Users { get; set; }
2020-10-06 07:06:05 +00:00
protected override void OnModelCreating(ModelBuilder modelBuilder)
2020-10-14 09:11:04 +00:00
{
ModelBuilderWrapper
.From(modelBuilder, Provider)
.AddAuditEvent()
.AddUser()
2020-10-14 09:11:04 +00:00
.AddDbFunction();
2021-08-03 14:11:53 +00:00
}
protected override Dictionary<Provider, Func<BaseDbContext>> ProviderContext
{
get
{
return new Dictionary<Provider, Func<BaseDbContext>>()
{
Merge branch 'develop' into feature/auto-migrations # Conflicts: # common/ASC.Core.Common/EF/Context/UserDbContext.cs # common/ASC.Core.Common/EF/Model/DbWebstudioUservisit.cs # common/ASC.Core.Common/Migrations/MySql/AccountLinkContextMySql/20210309093101_AccountLinkContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/AccountLinkContextMySql/20210309093101_AccountLinkContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/AccountLinkContextMySql/20210803210910_AccountLinkContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/AccountLinkContextMySql/20210803210910_AccountLinkContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/AccountLinkContextMySql/20211012145324_AccountLinkContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/AccountLinkContextMySql/20211012145324_AccountLinkContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/AccountLinkContextMySql/MySqlAccountLinkContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/CoreDbContextMySql/20211012145320_CoreDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/CoreDbContextMySql/20211012145320_CoreDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/CoreDbContextMySql/MySqlCoreDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/DbContextMySql/20210309093934_DbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/DbContextMySql/20210309093934_DbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/DbContextMySql/20210803211510_DbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/DbContextMySql/20210803211510_DbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/DbContextMySql/20211012145326_DbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/DbContextMySql/20211012145326_DbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/DbContextMySql/MySqlDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/FeedDbContextMySql/20210309094059_FeedDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/FeedDbContextMySql/20210309094059_FeedDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/FeedDbContextMySql/20210803211718_FeedDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/FeedDbContextMySql/20210803211718_FeedDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/FeedDbContextMySql/20211012145328_FeedDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/FeedDbContextMySql/20211012145328_FeedDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/FeedDbContextMySql/MySqlFeedDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/FilesDbContextMySql/20210309094212_FilesDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/FilesDbContextMySql/20210309094212_FilesDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/FilesDbContextMySql/20210803211941_FilesDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/FilesDbContextMySql/20210803211941_FilesDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/FilesDbContextMySql/20211012145330_FilesDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/FilesDbContextMySql/20211012145330_FilesDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/FilesDbContextMySql/MySqlFilesDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/MailDbContextMySql/20210309094321_MailDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/MailDbContextMySql/20210309094321_MailDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/MailDbContextMySql/20210803212237_MailDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/MailDbContextMySql/20210803212237_MailDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/MailDbContextMySql/20211012145332_MailDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/MailDbContextMySql/20211012145332_MailDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/MailDbContextMySql/MySqlMailDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20210803212546_MessagesContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/20211012145334_MessagesContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/MessagesContextMySql/MySqlMessagesContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/NotifyDbContextMySql/20210309094710_NotifyDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/NotifyDbContextMySql/20210309094710_NotifyDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/NotifyDbContextMySql/20210803212728_NotifyDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/NotifyDbContextMySql/20210803212728_NotifyDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/NotifyDbContextMySql/20211012145336_NotifyDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/NotifyDbContextMySql/20211012145336_NotifyDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/NotifyDbContextMySql/MySqlNotifyDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/ResourceDbContextMySql/20210309094839_ResourceDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/ResourceDbContextMySql/20210309094839_ResourceDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/ResourceDbContextMySql/20210803212948_ResourceDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/ResourceDbContextMySql/20210803212948_ResourceDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/ResourceDbContextMySql/20211012145338_ResourceDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/ResourceDbContextMySql/20211012145338_ResourceDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/ResourceDbContextMySql/MySqlResourceDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/TelegramDbContextMySql/20210309095003_TelegramDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/TelegramDbContextMySql/20210309095003_TelegramDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/TelegramDbContextMySql/20210803213120_TelegramDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/TelegramDbContextMySql/20210803213120_TelegramDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/TelegramDbContextMySql/20211012145340_TelegramDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/TelegramDbContextMySql/20211012145340_TelegramDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/TelegramDbContextMySql/MySqlTelegramDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/20210309095116_TenantDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/20210309095116_TenantDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/20210803213311_TenantDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/20210803213311_TenantDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/20211012145342_TenantDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/20211012145342_TenantDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/MySqlTenantDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/UserDbContextMySql/20210309095256_UserDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/UserDbContextMySql/20210803213502_UserDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/UserDbContextMySql/20211012145322_UserDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/UserDbContextMySql/MySqlUserDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/VoipDbContextMySql/20210309095409_VoipDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/VoipDbContextMySql/20210309095409_VoipDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/VoipDbContextMySql/20210803213656_VoipDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/VoipDbContextMySql/20210803213656_VoipDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/VoipDbContextMySql/20211012145344_VoipDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/VoipDbContextMySql/20211012145344_VoipDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/VoipDbContextMySql/MySqlVoipDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210309100343_WebstudioDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210803213819_WebstudioDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20210803213819_WebstudioDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20211012145346_WebstudioDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/20211012145346_WebstudioDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/WebstudioDbContextMySql/MySqlWebstudioDbContextModelSnapshot.cs # products/ASC.Files/Core/Migrations/MySql/FilesDbContextMySql/20210309125119_FilesDbContextMySql.Designer.cs # products/ASC.Files/Core/Migrations/MySql/FilesDbContextMySql/20210309125119_FilesDbContextMySql.cs # products/ASC.Files/Core/Migrations/MySql/FilesDbContextMySql/20210804103345_FilesDbContextMySql.Designer.cs # products/ASC.Files/Core/Migrations/MySql/FilesDbContextMySql/20210804103345_FilesDbContextMySql.cs # products/ASC.Files/Core/Migrations/MySql/FilesDbContextMySql/20211022170840_FilesDbContextMySql.Designer.cs # products/ASC.Files/Core/Migrations/MySql/FilesDbContextMySql/20211022170840_FilesDbContextMySql.cs # products/ASC.Files/Core/Migrations/MySql/FilesDbContextMySql/MySqlFilesDbContextModelSnapshot.cs
2021-10-25 17:52:13 +00:00
{ Provider.MySql, () => new MySqlAuditTrailContext() } ,
{ Provider.PostgreSql, () => new PostgreSqlAuditTrailContext() } ,
2021-08-03 14:11:53 +00:00
};
}
2020-10-06 07:06:05 +00:00
}
}
public static class AuditTrailContextExtension
{
public static DIHelper AddAuditTrailContextService(this DIHelper services)
{
return services.AddDbContextManagerService<AuditTrailContext>();
}
}
}