pavelbannov
ea4fa97838
# Conflicts: # ASC.Tests.sln # common/ASC.Core.Common/EF/Model/Tenant/DbQuota.cs # common/ASC.Core.Common/Migrations/MySql/CoreDbContextMySql/20210309093641_CoreDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/CoreDbContextMySql/20210309093641_CoreDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/CoreDbContextMySql/MySqlCoreDbContextModelSnapshot.cs # common/ASC.Data.Backup.Core/Core/DbHelper.cs # common/ASC.Data.Backup.Core/Storage/BackupRepository.cs # common/Tests/ASC.Common.Tests/ASC.Common.Tests.csproj # common/Tests/ASC.Core.Common.Tests/ASC.Core.Common.Tests.csproj # common/Tests/ASC.Notify.Textile.Tests/ASC.Notify.Textile.Tests.csproj
39 lines
992 B
C#
39 lines
992 B
C#
using ASC.Common;
|
|
using ASC.Core.Common.EF;
|
|
using ASC.Core.Common.EF.Model;
|
|
using ASC.Data.Backup.EF.Model;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
namespace ASC.Data.Backup.EF.Context
|
|
{
|
|
public class BackupsContext : BaseDbContext
|
|
{
|
|
public DbSet<BackupRecord> Backups { get; set; }
|
|
public DbSet<BackupSchedule> Schedules { get; set; }
|
|
|
|
public BackupsContext() { }
|
|
public BackupsContext(DbContextOptions<BackupsContext> options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
ModelBuilderWrapper
|
|
.From(modelBuilder, Provider)
|
|
.AddDbTenant()
|
|
.AddDbTariff();
|
|
}
|
|
}
|
|
|
|
public static class BackupsContextExtension
|
|
{
|
|
public static DIHelper AddBackupsContext(this DIHelper services)
|
|
{
|
|
return services.AddDbContextManagerService<BackupsContext>();
|
|
}
|
|
}
|
|
}
|