mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
17 lines
452 B
C#
17 lines
452 B
C#
using Govor.Core.Models.Users;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace Govor.Data.Configurations;
|
|
|
|
public class AdminConfiguration : IEntityTypeConfiguration<Admin>
|
|
{
|
|
public void Configure(EntityTypeBuilder<Admin> builder)
|
|
{
|
|
builder.HasKey(a => a.UserId);
|
|
|
|
builder.HasOne(a => a.User)
|
|
.WithOne()
|
|
.HasForeignKey<Admin>(a => a.UserId);
|
|
}
|
|
} |