开发者

Are Complex Types in Entity Framework actually inheritance?

开发者 https://www.devze.com 2022-12-21 07:46 出处:网络
I am learning EF and came across the definition of a Complex Type: \"...used to define common properties among various entities.\"

I am learning EF and came across the definition of a Complex Type:

"...used to define common properties among various entities."

This sounds exactly like factoring out shared state from a class and moving it into a base class. My question is - is this inheritance from EF's perspective ? I know that inheritance is supported in EF and tha开发者_开发问答t there are 3 ways to acheive it, but Complex Type sounds like it's separate from this. Is it ?

Thanks


No, it's not inheritance. ComplexType is more like a struct. It lumps a bunch of scalar properties together with value semantics.

You can do inheritance in the EF, yes, but nothing can inherit from a ComplexType.

0

精彩评论

暂无评论...
验证码 换一张
取 消