This question is locked. New answers and comments are not allowed.
Hello,
I'm using visual designer and the contextdb object to access to data. I have a entity class and a entity subclass derived.
How can I get from the contextdb the entity set of the sub class? I can only get the parent class entity set (contextdb.parentClasses)
I'm using visual designer and the contextdb object to access to data. I have a entity class and a entity subclass derived.
How can I get from the contextdb the entity set of the sub class? I can only get the parent class entity set (contextdb.parentClasses)
4 Answers, 1 is accepted
0
Hi Tajes,
Zoran
the Telerik team
We tested the scenario you described - having inheritance in our designer and the context is always generated with endpoints for all of the classes - base classes or subclasses. If your context is not being generated with an endpoint for your derived class - it means this is a bug on our side. However since we did not reproduce it, I would like to ask you if you could send us your .rlinq file so we can test the behavior locally and if a bug is confirmed - deliver a fix as soon as possible.
Best wishes,Zoran
the Telerik team
0
Tajes
Top achievements
Rank 1
answered on 18 Mar 2011, 09:36 AM
Hello Zoran,
Thank you for your quick reply. I have installed the Q1 2011 release and the issue has been corrected. Only one question more:
If I have another class related with the parent class, how can I select only the subclass' items through the navigation property of the first class?
thanks in advance.
Thank you for your quick reply. I have installed the Q1 2011 release and the issue has been corrected. Only one question more:
If I have another class related with the parent class, how can I select only the subclass' items through the navigation property of the first class?
class
ParentClass{}
class
SubClass{}
class
OtherClass
{
IList<ParentClass> navigationProperty;
}
//.......................................................
OtherClass otherClass;
var subClasses = from x
in
otherClass.navigationProperty select x;
//<--How can I get only SubClass items?
thanks in advance.
0
Accepted
Hello Tajes,
Context would be the Generated OpenAccessConetxtClass from the Visual Designer that has IQueryable endpoints for all of the entities as its properties.
Zoran
the Telerik team
Here is the query you could write to get the SubClass items of a collection of ParentClass items:
var subEntitiesList = Context.OtherClasses.SelectMany(p => p.navigationProperty.OfType<SubClass>());
Context would be the Generated OpenAccessConetxtClass from the Visual Designer that has IQueryable endpoints for all of the entities as its properties.
Zoran
the Telerik team
0
Tajes
Top achievements
Rank 1
answered on 22 Mar 2011, 06:27 PM
Thank you very much Zoran