Stream custom live channels using your own media
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
663 B

using ErsatzTV.Core.Domain.Scheduling;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace ErsatzTV.Infrastructure.Data.Configurations.Scheduling;
public class TemplateGroupConfiguration : IEntityTypeConfiguration<TemplateGroup>
{
public void Configure(EntityTypeBuilder<TemplateGroup> builder)
{
builder.ToTable("TemplateGroup");
builder.HasIndex(b => b.Name)
.IsUnique();
builder.HasMany(b => b.Templates)
.WithOne(i => i.TemplateGroup)
.HasForeignKey(i => i.TemplateGroupId)
.OnDelete(DeleteBehavior.Cascade);
}
}