这是我的情况:
public abstract class Article
{
[key]
public Guid Guid { get; set;}
public string Name { get; set;}
.
.
.
}
public class Download : Article
{
...
}
public abstract class Category : Article
{
...
}
public class DownloadCategory : Category
{
....
}
Run Code Online (Sandbox Code Playgroud)
然后我应该在下载之间有一个多对多的关系,DownloadCategory就像这样:
public class DownloadInCategory
{
[Key, Column(Order = 1), Required]
[ForeignKey("Download")]
Public Guid DownloadGuid { get; set; }
Public Download Download { get; set; }
[Key, Column(Order = 2), Required] …Run Code Online (Sandbox Code Playgroud)