相关疑难解决方法(0)

将多个表映射到实体框架中的单个实体类

在此之前被标记为重复,我已检查其他相关的帖子,他们不回答我的问题.

我正在处理一个遗留数据库,该数据库有2个具有1:1关系的表.目前,我为每个定义的表都有一个类型(1Test:1Result)我想将这些特定的表合并为一个类.

目前的类型看起来像这样

public class Result 
{
    public          string      Id                  { get; set; }
    public          string      Name                { get; set; }
    public          string      Text                { get; set; }
    public          string      Units               { get; set; }
    public          bool        OutOfRange          { get; set; }
    public          string      Status              { get; set; }
    public          string      Minimum             { get; set; }
    public          string      Maximum             { get; set; }

    public virtual  Instrument  InstrumentUsed      { get; set; }

    public virtual  Test        ForTest             { get; set; }
} …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework c#-4.0 entity-framework-4.1 asp.net-mvc-3

28
推荐指数
1
解决办法
3万
查看次数