Key property on base class without hosting relationship which is defined on an inherited class

Hello,

I have a BaseClass which is marked Abstract=true and Hosted=false. Then I have an InheritedClass which has the BaseClass as its Base. This InheritedClass is Hosted=true while being Abstract=false. You know, the BaseClass has some common attributes for two different InheritedClasses which define different hosting relationships. 

The only Key property is declared on the BaseClass. The InheritedClass does not have its own, more specialized, Key property.

It seems the Key property on the abstract un-hosted BaseClass enforces the Key value globally and not only for the hosting parent of the InheritedClass. Am I right?

How do I make the BaseClass's Key property be scoped to the InheritedClass's hosting parent?

ondrej.

February 9th, 2015 5:15am

Hi,

if I understood the question correct than you need to change your model's design.

"A key property uniquely identifies each instance of a particular class. If a property is marked as a key property, each instance of the class must have a unique value, and the value may not be null. For hosted classes, the value must only be unique for all instances of the class that have the same hosting parent. For unhosted classes, it must be unique for all instances of the class in the management group." ( https://technet.microsoft.com/en-us/library/ee957039.aspx)

Free Windows Admin Tool Kit Click here and download it now
February 9th, 2015 5:35am

yes, thank you, this is what I thought. I just tried to find a more fortunate solution :-) Thank you!

ondrej.

February 9th, 2015 5:40am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics