mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
* Update crowdfund defaults * Crowdfund: Move sound, animation and discussion into additional options * Update sound URLs Fixes #3745. * Update featured image URL label * Improve the recurring goal section * Crowdfund: Goal section finetuning
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace BTCPayServer.Data
|
|
{
|
|
public class AppData
|
|
{
|
|
public string Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string StoreDataId { get; set; }
|
|
public string AppType { get; set; }
|
|
public StoreData StoreData { get; set; }
|
|
public DateTimeOffset Created { get; set; }
|
|
public bool TagAllInvoices { get; set; }
|
|
public string Settings { get; set; }
|
|
|
|
internal static void OnModelCreating(ModelBuilder builder)
|
|
{
|
|
builder.Entity<AppData>()
|
|
.HasOne(o => o.StoreData)
|
|
.WithMany(i => i.Apps).OnDelete(DeleteBehavior.Cascade);
|
|
builder.Entity<AppData>()
|
|
.HasOne(a => a.StoreData);
|
|
}
|
|
|
|
// utility methods
|
|
public T GetSettings<T>() where T : class, new()
|
|
{
|
|
return string.IsNullOrEmpty(Settings) ? new T() : JsonConvert.DeserializeObject<T>(Settings);
|
|
}
|
|
|
|
public void SetSettings(object value)
|
|
{
|
|
Settings = value == null ? null : JsonConvert.SerializeObject(value);
|
|
}
|
|
}
|
|
}
|