btcpayserver/BTCPayServer.Data/Data/NotificationData.cs

33 lines
1,014 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
2020-06-12 00:16:50 -05:00
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2020-05-28 15:15:24 -05:00
using Microsoft.EntityFrameworkCore;
2020-05-28 15:15:24 -05:00
namespace BTCPayServer.Data
{
public class NotificationData
{
2020-06-12 00:16:50 -05:00
[MaxLength(36)]
public string Id { get; set; }
public DateTimeOffset Created { get; set; }
2020-06-12 00:16:50 -05:00
[MaxLength(50)]
public string ApplicationUserId { get; set; }
2020-05-28 15:15:24 -05:00
public ApplicationUser ApplicationUser { get; set; }
2020-06-12 00:16:50 -05:00
[MaxLength(100)]
public string NotificationType { get; set; }
public bool Seen { get; set; }
public byte[] Blob { get; set; }
2020-05-28 15:15:24 -05:00
internal static void OnModelCreating(ModelBuilder builder)
{
builder.Entity<NotificationData>()
.HasOne(o => o.ApplicationUser)
.WithMany(n => n.Notifications)
2020-06-13 18:45:44 -05:00
.HasForeignKey(k => k.ApplicationUserId).OnDelete(DeleteBehavior.Cascade);
2020-05-28 15:15:24 -05:00
}
}
}