2020-06-28 21:44:35 -05:00
|
|
|
using System;
|
2020-06-27 21:55:16 +09:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2017-09-13 15:47:34 +09:00
|
|
|
|
|
|
|
namespace BTCPayServer.Data
|
|
|
|
{
|
2019-08-30 00:24:42 +09:00
|
|
|
public class AddressInvoiceData
|
2017-10-27 17:53:04 +09:00
|
|
|
{
|
2019-08-30 00:24:42 +09:00
|
|
|
/// <summary>
|
|
|
|
/// Some crypto currencies share same address prefix
|
|
|
|
/// For not having exceptions thrown by two address on different network, we suffix by "#CRYPTOCODE"
|
|
|
|
/// </summary>
|
|
|
|
[Obsolete("Use GetHash instead")]
|
2020-12-28 14:57:21 -06:00
|
|
|
public string Address { get; set; }
|
|
|
|
public InvoiceData InvoiceData { get; set; }
|
|
|
|
public string InvoiceDataId { get; set; }
|
|
|
|
public DateTimeOffset? CreatedTime { get; set; }
|
2017-09-13 15:47:34 +09:00
|
|
|
|
2019-08-30 00:24:42 +09:00
|
|
|
|
2020-06-27 21:55:16 +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-10-27 17:53:04 +09:00
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
}
|