What are complex types in Entity Framework?

Technology CommunityCategory: Entity FrameworkWhat are complex types in Entity Framework?
VietMX Staff asked 3 years ago

There can be situations where you have common properties across entities. For example, consider the below figure where we have Customer and Supplier entities. They have three fields in common: Address1, Address2, and PhoneNo. These fields have been duplicated both in the Customer and Supplier entities.

So to remove these duplicate and redundant fields, we can move them to a common complex type called Address. Complex types group common fields so that they can be reused across entities.