本文介绍了使用相同的键与不同的tablas进行关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,这是我的问题:

我有两个表亲属(IDRelative为Key,Name等)和Residents(IDResident为密钥,IDSignal,IDTypeSignal等)

>我想建立一个关系IDResident - > IDSignal或IDRelative - > IDSignal是IDTypeSignal值的函数。

如果IDTypeSignal = 1则关系将是IDResident - > IDSignal

如果IDTypeSignal = 2那么关系将是IDRelative - > IDSignal

如果IDTypeSignal = -1则没有关系。


我想用EntityFramework建模这种关系,但我不确定如果这种关系可以做到。


有可能建模吗?

谢谢。

Hello, here is my question:

I have two tables Relatives (with IDRelative as Key,Name etc) and Residents (with IDResident as key, IDSignal, IDTypeSignal and so on)

I want to make a relation IDResident --> IDSignal or IDRelative --> IDSignal in function of the value of IDTypeSignal.

If IDTypeSignal = 1 then the relation will be IDResident --> IDSignal

If IDTypeSignal = 2 then the relation will be IDRelative --> IDSignal

If IDTypeSignal = -1 then there is no relation.


I want to model this relations with EntityFramework but I´m not sure If this kind of Relations are possible to do.


Is that possible to model?

Thank you.

推荐答案


这篇关于使用相同的键与不同的tablas进行关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 09:24