LinqConnect Documentation
In This Topic
    Modifying Complex Types
    In This Topic
    Modifying Complex Types
    LinqConnect Documentation
    Modifying Complex Types
    [email protected]

    In LinqConnect complex types are classes - reference types. That means modifying properties of complex type objects does not modify the corresponding complex type property of an entity.

    This is important when entities implement the INotifyPropertyChanged interface. Suppose we have separated the AdressType complex type from the Company entity.

    Complex type

    The City property is implemented in the AddressType class, not in the Company class, and the City setter cannot raise the PropertyChanging event in the Company class. However we can implement INotifyPropertyChanging in the AddressType class and raise its PropertyChanging event. The LinqConnect runtime subscribes to this event and performs the change tracking in this object when the event is raised.

    So, if an entity implements INotifyPropertyChanging and has complex type properties, then these complex types must implement INotifyPropertyChanging too. 'LinqConnect' and 'POCO Entities' templates generate code that satisfies this requirement.