mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
33 lines
864 B
C#
33 lines
864 B
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace BTCPayServer.Data
|
|
{
|
|
public class WebhookDeliveryData
|
|
{
|
|
[Key]
|
|
[MaxLength(25)]
|
|
public string Id { get; set; }
|
|
[MaxLength(25)]
|
|
[Required]
|
|
public string WebhookId { get; set; }
|
|
public WebhookData Webhook { get; set; }
|
|
|
|
[Required]
|
|
public DateTimeOffset Timestamp { get; set; }
|
|
|
|
[Required]
|
|
public byte[] Blob { get; set; }
|
|
|
|
|
|
internal static void OnModelCreating(ModelBuilder builder)
|
|
{
|
|
builder.Entity<WebhookDeliveryData>()
|
|
.HasOne(o => o.Webhook)
|
|
.WithMany(a => a.Deliveries).OnDelete(DeleteBehavior.Cascade);
|
|
builder.Entity<WebhookDeliveryData>().HasIndex(o => o.WebhookId);
|
|
}
|
|
}
|
|
}
|