考虑为一体的两个表 [英] two tables considered as one

查看:88
本文介绍了考虑为一体的两个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表是这样的:

Table1(id, name)
Table2(id_of_table_1, code)

我并不需要一个实体的表1和表2,而是一个实体两者一起:

I don't need an entity for Table1 or Table2, but one entity for both together:

class Merge{
    public virtual long id{get;set;}
    public virtual string name{get;set;}
    public virtual string code{get;set;}
}

我如何可以加载表到EDMX使它们视为一个?

How can I load the tables to the edmx so that they will considered as one?

我没有对数据库的任何控制,我不能创建表或视图。

I don't have any control on the database and I can't create tables or views.

推荐答案

您正在寻找所谓的实体分裂

这篇关于考虑为一体的两个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆