So far, we have covered many straightforward scenarios that one can easily model with Entity Framework to create database structures. All of them are mapped to one table with scalar values to a class with a matching set of properties. There are use cases when this approach does not work quite as well, and we will walk through a functionality in Entity Framework that supports more complex modeling techniques.
Complex types are classes that map to a subset of columns in a table in the database. They are similar to entity classes, except that they do not contain key fields and do not directly map to an entire table. Complex types are helpful when we have the same set of properties that are common to multiple entities. Another use case is when we want to group some properties, in order to provide a clear semantic meaning to such a group of properties. By introducing a complex type into our modeling workflow, we provide more consistency for database structures...