2020-05-27 18:41:00 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2020-06-12 00:16:50 -05:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2020-05-27 18:41:00 -05:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2020-05-28 15:15:24 -05:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2020-05-27 18:41:00 -05:00
|
|
|
|
|
2020-05-28 15:15:24 -05:00
|
|
|
|
namespace BTCPayServer.Data
|
2020-05-27 18:41:00 -05:00
|
|
|
|
{
|
|
|
|
|
public class NotificationData
|
|
|
|
|
{
|
2020-06-12 00:16:50 -05:00
|
|
|
|
[MaxLength(36)]
|
2020-05-27 18:41:00 -05:00
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
public DateTimeOffset Created { get; set; }
|
2020-06-12 00:16:50 -05:00
|
|
|
|
[MaxLength(50)]
|
2020-05-27 18:41:00 -05:00
|
|
|
|
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)]
|
2020-05-27 18:41:00 -05:00
|
|
|
|
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
|
|
|
|
}
|
2020-05-27 18:41:00 -05:00
|
|
|
|
}
|
|
|
|
|
}
|