Files
ersatztv/ErsatzTV.Infrastructure/Data/Configurations/Metadata/ArtistMetadataConfiguration.cs
T
Jason DoveandGitHub 1ab98578ab refactor namespaces and imports (#670)
* re-namespace

* optimize usings

* more usings

* more of the same

* more implicit/global usings

* cleanup all usings

* minor fixes
2022-03-03 15:36:07 -06:00

29 lines
839 B
C#

using ErsatzTV.Core.Domain;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace ErsatzTV.Infrastructure.Data.Configurations;
public class ArtistMetadataConfiguration : IEntityTypeConfiguration<ArtistMetadata>
{
public void Configure(EntityTypeBuilder<ArtistMetadata> builder)
{
builder.ToTable("ArtistMetadata");
builder.HasMany(sm => sm.Artwork)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
builder.HasMany(sm => sm.Genres)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
builder.HasMany(sm => sm.Styles)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
builder.HasMany(sm => sm.Moods)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
}
}