【发布时间】:2017-02-13 15:43:14
【问题描述】:
如何使用数据注释或 fluentapi 指定模型中的字符串列表,例如外键列表?我知道我可以在列表中指定 User 模型,但我想要一个字符串列表。
模型示例:
public class Allocation
{
[Key]
public int Id { get; set; }
...
public List<string> Users { get; set; }
}
public class User
{
[Key]
public string Id { get; set; }
...
}
【问题讨论】:
标签: c# asp.net sql-server entity-framework ef-fluent-api