mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-28 11:24:27 +01:00
27 lines
919 B
C#
27 lines
919 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace BTCPayServer.Data
|
|
{
|
|
public class InvoiceWebhookDeliveryData
|
|
{
|
|
public string InvoiceId { get; set; }
|
|
public InvoiceData Invoice { get; set; }
|
|
public string DeliveryId { get; set; }
|
|
public WebhookDeliveryData Delivery { get; set; }
|
|
internal static void OnModelCreating(ModelBuilder builder)
|
|
{
|
|
builder.Entity<InvoiceWebhookDeliveryData>()
|
|
.HasKey(p => new { p.InvoiceId, p.DeliveryId });
|
|
builder.Entity<InvoiceWebhookDeliveryData>()
|
|
.HasOne(o => o.Invoice)
|
|
.WithOne().OnDelete(DeleteBehavior.Cascade);
|
|
builder.Entity<InvoiceWebhookDeliveryData>()
|
|
.HasOne(o => o.Delivery)
|
|
.WithOne().OnDelete(DeleteBehavior.Cascade);
|
|
}
|
|
}
|
|
}
|