btcpayserver/BTCPayServer.Data/Data/AddressInvoiceData.cs

26 lines
758 B
C#
Raw Normal View History

2020-06-28 21:44:35 -05:00
using System;
using Microsoft.EntityFrameworkCore;
2023-11-21 14:11:17 +09:00
using Microsoft.EntityFrameworkCore.Metadata.Internal;
2017-09-13 15:47:34 +09:00
namespace BTCPayServer.Data
{
public class AddressInvoiceData
{
public string Address { get; set; }
public InvoiceData InvoiceData { get; set; }
public string InvoiceDataId { get; set; }
2017-09-13 15:47:34 +09:00
internal static void OnModelCreating(ModelBuilder builder)
{
builder.Entity<AddressInvoiceData>()
.HasOne(o => o.InvoiceData)
.WithMany(i => i.AddressInvoices).OnDelete(DeleteBehavior.Cascade);
builder.Entity<AddressInvoiceData>()
#pragma warning disable CS0618
.HasKey(o => o.Address);
#pragma warning restore CS0618
}
}
2017-09-13 15:47:34 +09:00
}