Add Webhooks in store's settings

This commit is contained in:
nicolas.dorier
2020-11-06 20:42:26 +09:00
parent cc6fe24e82
commit f3611ac693
38 changed files with 1756 additions and 28 deletions

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EntityFrameworkCore;
using System.Linq;
namespace BTCPayServer.Data
{
public class StoreWebhookData
{
public string StoreId { get; set; }
public string WebhookId { get; set; }
public WebhookData Webhook { get; set; }
public StoreData Store { get; set; }
internal static void OnModelCreating(ModelBuilder builder)
{
builder.Entity<StoreWebhookData>()
.HasKey(p => new { p.StoreId, p.WebhookId });
builder.Entity<StoreWebhookData>()
.HasOne(o => o.Webhook)
.WithOne().OnDelete(DeleteBehavior.Cascade);
builder.Entity<StoreWebhookData>()
.HasOne(o => o.Store)
.WithOne().OnDelete(DeleteBehavior.Cascade);
}
}
}