DocSpace-buildtools/common/ASC.Data.Backup.Core/EF/BackupsContext.cs
pavelbannov ea4fa97838 Merge branch 'develop' into feature/wizard/migration
# 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
2021-09-15 15:52:13 +03:00

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>();
}
}
}