#58 added owned entity for SocialNetworks that belongs to an ApplicationUser
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using Hutopy.Infrastructure.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Hutopy.Infrastructure.Data.Configurations;
|
||||
|
||||
public class ApplicationUserConfiguration : IEntityTypeConfiguration<ApplicationUser>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ApplicationUser> builder)
|
||||
{
|
||||
// Relationship between ApplicationUser and SocialNetworks
|
||||
builder
|
||||
.OwnsOne(u => u.SocialNetworks)
|
||||
.ToTable($"{nameof(ApplicationUser)}_SocialNetworks");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user