Files
void.cat/VoidCat/Database/Configurations/PaywallConfiguration.cs
Kieran 4de977c1dd v5 (#65)
Co-authored-by: Kieran <kieran@harkin.me>
Reviewed-on: https://git.v0l.io/Kieran/void.cat/pulls/65
2023-05-09 13:56:57 +00:00

29 lines
745 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace VoidCat.Database.Configurations;
public class PaywallConfiguration : IEntityTypeConfiguration<Paywall>
{
public void Configure(EntityTypeBuilder<Paywall> builder)
{
builder.ToTable("Payment");
builder.HasKey(a => a.Id);
builder.Property(a => a.Service)
.IsRequired();
builder.Property(a => a.Currency)
.IsRequired();
builder.Property(a => a.Amount)
.IsRequired();
builder.Property(a => a.Required)
.IsRequired();
builder.HasOne(a => a.File)
.WithOne(a => a.Paywall)
.HasForeignKey<Paywall>();
}
}