Files
zap-stream-api/NostrStreamer/Database/Configuration/UserStreamClipConfiguration.cs
2023-12-08 14:50:02 +00:00

26 lines
710 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace NostrStreamer.Database.Configuration;
public class UserStreamClipConfiguration : IEntityTypeConfiguration<UserStreamClip>
{
public void Configure(EntityTypeBuilder<UserStreamClip> builder)
{
builder.HasKey(a => a.Id);
builder.Property(a => a.Created)
.IsRequired();
builder.Property(a => a.TakenByPubkey)
.IsRequired();
builder.Property(a => a.Url)
.IsRequired();
builder.HasOne(a => a.UserStream)
.WithMany()
.HasForeignKey(a => a.UserStreamId)
.HasPrincipalKey(a => a.Id);
}
}