41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
|
|
using APT.Domain;
|
|||
|
|
using Microsoft.EntityFrameworkCore;
|
|||
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Text;
|
|||
|
|
|
|||
|
|
namespace APT.DAL.Data
|
|||
|
|
{
|
|||
|
|
public class UserMap : IEntityTypeConfiguration<APT_Test_User>
|
|||
|
|
{
|
|||
|
|
//public UserMap(ModelBuilder builder)
|
|||
|
|
//{
|
|||
|
|
// builder.Entity<APT_Test_User>(c =>
|
|||
|
|
// {
|
|||
|
|
// c.HasMany(o => o.TestPhones)
|
|||
|
|
// .WithOne(o => o.TestUser)
|
|||
|
|
// .HasForeignKey(o => o.TestUser_ID);
|
|||
|
|
|
|||
|
|
// c.HasMany(o => o.Courses)
|
|||
|
|
// .WithOne(o => o.TestUser)
|
|||
|
|
// .HasForeignKey(o => o.UserID);
|
|||
|
|
// });
|
|||
|
|
|
|||
|
|
// builder.Entity<APT_Test_User>().Property(t => t.IS_DELETED).HasColumnType("bit(1)");
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
public virtual void Configure(EntityTypeBuilder<APT_Test_User> builder)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
//builder.HasMany(o => o.TestPhones)
|
|||
|
|
//.WithOne(o => o.Nav_TestUser)
|
|||
|
|
//.HasForeignKey(o => o.TestUser_ID);
|
|||
|
|
|
|||
|
|
builder.HasMany(o => o.Courses)
|
|||
|
|
.WithOne(o => o.TestUser)
|
|||
|
|
.HasForeignKey(o => o.UserID);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|