using System; using System.Collections.Generic; using System.Data.Entity.ModelConfiguration; using System.Linq; using System.Text; using System.Threading.Tasks; using GreenTree.Nachtragsmanagement.Core.Domain.Misc; namespace GreenTree.Nachtragsmanagement.Data.Mapping.Misc { public class MailNotificationMap : EntityTypeConfiguration { public MailNotificationMap() { ToTable("MailNotification"); HasKey(m => m.Id); Property(m => m.CronExpression); Property(m => m.IsDailySummary); Property(m => m.IsWeeklySummary); Property(m => m.IsMonthlySummary); HasOptional(m => m.NotificationEvent) .WithMany() .HasForeignKey(m => m.NotificationEventId); HasOptional(m => m.NotificationEventType) .WithMany() .HasForeignKey(m => m.NotificationEventTypeId); HasMany(m => m.Users) .WithMany(u => u.MailNotifications) .Map(m => m.ToTable("UserMailNotifications")); } } }