btcpayserver/BTCPayServer.Data/Data/PaymentData.cs

40 lines
831 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;
}
2017-09-13 15:47:34 +09:00
public string InvoiceDataId
{
get; set;
}
public InvoiceData InvoiceData
{
get; set;
}
2017-09-13 15:47:34 +09:00
public byte[] Blob
{
get; set;
}
2017-11-06 00:31:02 -08:00
public bool Accounted
{
get; set;
}
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
}