如何将表列映射到两个实体属性? [英] How to map a table column to two entity properties?

查看:68
本文介绍了如何将表列映射到两个实体属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这种情况下,我正在尝试映射表列 IsActive 到两个不同的实体属性.有什么办法吗?

Following this case, i'm trying to map a table column IsActive to two different entity property. is there any way to do this?

推荐答案

这是不可能的.每列只能映射一次,否则会导致不一致.例如,如果您要为每个属性设置不同的值,那么应该保存哪个?同时具有两个暴露相同字段的属性也没有道理.

It is not possible. Each column must be mapped only once because otherwise it would lead to inconsistencies. For example if you would set different value to each property which one should be saved? Also having two properties exposing same field doesn't make sense.

这篇关于如何将表列映射到两个实体属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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