Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I believe I have discovered a bug with the Dynamic Data Store when using inheritance.
In the documentation it says that in order to save a property in the Dynamic Data Store, the property must be public and have a setter (which can be non-public). Properties without setters are ignored. For instance, in the following object, MyProperty will be added in the Dynamic Data Store but MyGetterProperty will not:
This is working as you would expect. However, consider this example where I instead implement MyGetterProperty in a abstract base class:
In this example, if I save an object of MyData to the Dynamic Data Store, MyGetterProperty now gets included in the database! When I try to read an object from the store I get an error in DereferencedPropertyBag.ToClonedObject saying that the property cannot be written because no setter was available. The error is that the getter property from the base class gets included in the Dynamic Data Store.
Am I correct in assuming that this is a bug? Is there a workaround to the problem or am I perhaps doing something wrong?