My code won't compile when I use names similar to properties in the base class

Aglaia avatar
LLBLGen Pro Team
Posts: 535
Joined: 07-Sep-2003
# Posted on: 21-Aug-2007 14:20:15   

Question: When I give a field mapped on a relation or a field in one of my entities a name similar to a property exposed in the base classes (for example 'Fields'), my code won't compile. How can this be?

Solution: All code generated by LLBLGen Pro, which thus contains your project specific names and values, in fact customizes generic code compiled into the ORMSupport classes. This means that if you name a field like 'Fields' it will be generated as a property 'Fields' in your entity class, and by that hide the Fields property of the EntityBase(2) class. This is by design. To work around this, rename your field so it won't clash with the property in the base class.