DocSpace-client/common/ASC.Data.Backup.Core/EF/BackupsContext.cs

30 lines
865 B
C#
Raw Normal View History

namespace ASC.Data.Backup.EF.Context
{
public class BackupsContext : BaseDbContext
{
public DbSet<BackupRecord> Backups { get; set; }
2020-05-29 14:48:27 +00:00
public DbSet<BackupSchedule> Schedules { get; set; }
public DbSet<DbTenant> Tenants { get; set; }
public BackupsContext() { }
public BackupsContext(DbContextOptions<BackupsContext> options)
: base(options)
{
}
2021-08-31 09:40:28 +00:00
2021-08-10 08:36:07 +00:00
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
ModelBuilderWrapper
.From(modelBuilder, Provider)
.AddDbTenant();
}
}
2020-06-10 12:35:10 +00:00
public static class BackupsContextExtension
{
2020-06-10 12:35:10 +00:00
public static DIHelper AddBackupsContext(this DIHelper services)
{
return services.AddDbContextManagerService<BackupsContext>();
2020-06-10 12:35:10 +00:00
}
}
}