【发布时间】:2020-11-30 03:36:44
【问题描述】:
AspNetUsers 表有一个我想使用的 Id 列。
这是我想为 AspNetUsers 表创建 fk 的“另一个表模型”:
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Project.Models
{
public class Profile
{
public int Id { get; set; }
public string Type { get; set; }
public string BusinessName { get; set; }
[DataType(DataType.ImageUrl)]
public string LogoUrl { get; set; }
public string Status { get; set; }
[ForeignKey("AspNetUsersId")]
public virtual ApplicationUser ApplicationUser { get; set; }
}
}
【问题讨论】:
标签: asp.net-core entity-framework-core asp.net-identity asp.net-core-3.1