btcpayserver/BTCPayServer.Data/Data/PaymentData.cs

25 lines
691 B
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore;
2017-09-13 15:47:34 +09:00
namespace BTCPayServer.Data
{
public class PaymentData
{
public string Id { get; set; }
public string InvoiceDataId { get; set; }
public InvoiceData InvoiceData { get; set; }
2017-09-13 15:47:34 +09:00
public byte[] Blob { get; set; }
public bool Accounted { get; set; }
2017-09-13 15:47:34 +09:00
internal static void OnModelCreating(ModelBuilder builder)
{
builder.Entity<PaymentData>()
.HasOne(o => o.InvoiceData)
.WithMany(i => i.Payments).OnDelete(DeleteBehavior.Cascade);
builder.Entity<PaymentData>()
.HasIndex(o => o.InvoiceDataId);
}
}
2017-09-13 15:47:34 +09:00
}