Multiple object sets of the same type

前端 未结 1 677
梦毁少年i
梦毁少年i 2021-01-05 03:00

I tried to create a data context in EF5 RC similar to this:

class WordContext : DbContext {
    public DbSet PossibleWords { get; set; }
    publ         


        
相关标签:
1条回答
  • 2021-01-05 03:26

    Presumably you are trying to represent 2 different tables in your original code. I would consider two classes, UsedWord and PossibleWord, and just have both of them implement a common interface, say: IWord? Or simpler, just have a bool "IsUsed" field on Word, and one table/type.

    0 讨论(0)
提交回复
热议问题