This is a migrated thread and some comments may be shown as answers.

Inheritance and WCF RIA Service

3 Answers 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Henk
Top achievements
Rank 1
Henk asked on 22 Oct 2010, 12:17 PM
Hi,

I try to use inheritance in my Domain Model and WCF RIA Service with a Silverlight client.
When I try to build the solution I get the following error:

The derived entity type 'InheritedType' must be declared in a KnownTypeAttribute on the root entity 'BaseType'.

Can these attributes be added?

Kind Regards.

3 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 27 Oct 2010, 06:00 PM
Hello Henk,

 That is attribute that comes with the RIA services. You will have to put it on your base class as the error suggests. Unfortunately currently we do not provide a way to mark your classes with custom attributes out of the box and this has to be done manually.

Kind regards,
Petar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Henk
Top achievements
Rank 1
answered on 28 Oct 2010, 12:27 PM
Hi Petar,

Thanks for your answer.
Do I need to add this code each time in the "class.generated.cs" files when these files are generated or is there a better place to add these attributes so my code is not overwritten each time I make a change to my model?

Kind Regards.
0
Accepted
PetarP
Telerik team
answered on 01 Nov 2010, 07:00 PM
Hi Henk,

 Class level attributes can be defined in a partial class so that they are not overwritten on each code generation. Unfortunately this is valid only for classes and it cannot be applied to properties as well.The property level attributes must be defined in the generated code and thus they will be overwritten.

Kind regards,
Petar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Henk
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Henk
Top achievements
Rank 1
Share this question
or