Files
zap-stream-api/NostrStreamer/Database/Configuration/IngestEndpointConfiguration.cs
2023-07-25 17:45:44 +01:00

31 lines
749 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace NostrStreamer.Database.Configuration;
public class IngestEndpointConfiguration : IEntityTypeConfiguration<IngestEndpoint>
{
public void Configure(EntityTypeBuilder<IngestEndpoint> builder)
{
builder.HasKey(a => a.Id);
builder.Property(a => a.Name)
.IsRequired();
builder.Property(a => a.App)
.IsRequired();
builder.Property(a => a.Forward)
.IsRequired();
builder.Property(a => a.Cost)
.IsRequired();
builder.Property(a => a.Capabilities)
.IsRequired();
builder.HasIndex(a => a.App)
.IsUnique();
}
}