Hi,
I am evaluating LLBLGen version 5.0.7 (and thus a total newbie) and everything have been going great so far, however I am have some troubles with a many-to-many relationship.
I have an inherited entity called "Fur". The "Fur" entity is the last in a hierarchy which at the top have an abstract entity called “Base”. The entity "Base" has a many-to-many relationship with an entity called "ActorHistory" via an entity called "CoBaseActorHistory". I am using the “Target per entity” inheritance type. See attached image for the model.
I am able in insert and query most data just fine, the problem is when I am trying to get all the "ActorHistory" entities related to a "Fur" entity.
My code looks like this:
FurEntity fur = null;
using (var adapter = new DataAccessAdapter(true))
{
var metaData = new LinqMetaData(adapter);
fur = metaData.Fur.SingleOrDefault(x => x.Collection.Name == "Some collection name");
List<ActorHistoryEntity> allActorsRelatedToFur = fur.ActorHistoryCollectionViaCoBaseActorHistory.ToList();
}
I have tried calling:
adapter.FetchNewEntity<ActorHistoryEntity>(fur.GetRelationInfoActorHistoryCollectionViaCoBaseActorHistory());
Before getting the list, but that does not seem to help. I am not sure I understand either the design of the navigation properties of the many-to-many relationship (since I have both the original 1:m relationship needed to create the many-to-many relationship, and the many-to-many relationship) or the code needed to get the data.
Is there something wrong with my design, or am I missing some call to load data?
Best regards
Andreas
Attachments
Filename |
File size |
Added on |
Approval |
Model.png
|
31,077 |
10-Nov-2016 15:37.16 |
Approved |