0
對於我的主鍵,可以使用Code First的幻像類型嗎?在EF Code First中使用幻影密鑰類型4.3
我有這樣的事情:
class Id<TEntity, TKey>
where TEntity : Entity
{
// implementation
}
class Entity<TEntity, TKey> {
[Key]
public Id<MyEntity, Guid> Id { get; set; }
}
class MyEntity : Entity<MyEntity, Guid> {
}
你是什麼意思的「幻影類型」?我發現他們中唯一的提及是與功能語言有關... – 2012-02-13 00:05:54
@ThomasLevesque - 看到這個問題http://stackoverflow.com/questions/5881301/implementing-phantom-types-in-c-sharp – 2012-02-13 00:16:22