Init
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace NostrStreamer.Database.Configuration;
|
||||
|
||||
public class PaymentsConfiguration : IEntityTypeConfiguration<Payment>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Payment> builder)
|
||||
{
|
||||
builder.HasKey(a => a.PubKey);
|
||||
builder.Property(a => a.Invoice)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(a => a.IsPaid)
|
||||
.IsRequired();
|
||||
}
|
||||
}
|
18
NostrStreamer/Database/Configuration/UserConfiguration.cs
Normal file
18
NostrStreamer/Database/Configuration/UserConfiguration.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace NostrStreamer.Database.Configuration;
|
||||
|
||||
public class UserConfiguration : IEntityTypeConfiguration<User>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<User> builder)
|
||||
{
|
||||
builder.HasKey(a => a.PubKey);
|
||||
builder.Property(a => a.StreamKey)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(a => a.Event);
|
||||
builder.Property(a => a.Balance)
|
||||
.IsRequired();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user