我有三张桌子:
Connection(OwnerGuid, ConnectionTypeId, Connection)
Instrument(Id, Guid, Model, Name, Description)
LaboratoryInfoSystem(Id, Guid, Model, Name, Description)
以及
rule
是那个吗
Instrument
只有一个连接和一个
LaboratoryInfoSystem
也只有一个连接。所以这两者之间的关系
仪器
和
Connection
也是一对一
实验室系统
和
连接
.
想法是
连接
表将保留连接
LaboratortInfoSystem
和
仪器
.为此,我声明
实验室磷系统
和
连接
通过使用
Guid
字段作为外键和主键
连接
表。
有更好的方法吗?
也在我使用后
Entity Framework
在
仪器
我班有这个:
public virtual Connection Connection { get; set; }
但是在
连接
我有:
public virtual ICollection<Instrument> Instruments { get; set; }
这告诉我关系不是
one-to-one
.
我怎么解决这个问题?