* re-namespace * optimize usings * more usings * more of the same * more implicit/global usings * cleanup all usings * minor fixes
29 lines
831 B
C#
29 lines
831 B
C#
using ErsatzTV.Core.Domain;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace ErsatzTV.Infrastructure.Data.Configurations;
|
|
|
|
public class SongMetadataConfiguration : IEntityTypeConfiguration<SongMetadata>
|
|
{
|
|
public void Configure(EntityTypeBuilder<SongMetadata> builder)
|
|
{
|
|
builder.ToTable("SongMetadata");
|
|
|
|
builder.HasMany(mm => mm.Artwork)
|
|
.WithOne()
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
builder.HasMany(mm => mm.Genres)
|
|
.WithOne()
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
builder.HasMany(mm => mm.Tags)
|
|
.WithOne()
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
builder.HasMany(mm => mm.Studios)
|
|
.WithOne()
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
}
|
|
} |