DocSpace-client/common/ASC.Core.Common/EF/Context/NotifyDbContext.cs

38 lines
1.0 KiB
C#
Raw Normal View History

2020-02-17 08:58:14 +00:00
using ASC.Common;
using ASC.Core.Common.EF.Model;
2019-12-10 13:42:29 +00:00
using Microsoft.EntityFrameworkCore;
namespace ASC.Core.Common.EF.Context
{
2020-08-21 02:34:37 +00:00
public partial class NotifyDbContext : BaseDbContext
2019-12-10 13:42:29 +00:00
{
public DbSet<NotifyInfo> NotifyInfo { get; set; }
public DbSet<NotifyQueue> NotifyQueue { get; set; }
2020-08-21 02:34:37 +00:00
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
2020-09-05 19:18:29 +00:00
/*
2020-08-27 21:45:07 +00:00
modelBuilder
2020-08-21 02:34:37 +00:00
.MySqlAddNotifyInfo()
.MySqlAddNotifyQueue();
2020-09-05 19:18:29 +00:00
*/
2020-08-27 21:45:07 +00:00
modelBuilder
.PgSqlAddNotifyInfo()
.PgSqlAddNotifyQueue(); ;
2020-09-05 19:18:29 +00:00
2020-08-21 02:34:37 +00:00
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
2019-12-10 13:42:29 +00:00
}
public static class NotifyDbExtension
{
2020-02-17 08:58:14 +00:00
public static DIHelper AddNotifyDbContext(this DIHelper services)
2019-12-10 13:42:29 +00:00
{
2019-12-10 15:06:51 +00:00
return services.AddDbContextManagerService<NotifyDbContext>();
2019-12-10 13:42:29 +00:00
}
}
}