Version: 2.6.9.220
Trace output:
: Initial expression to process:
value(SD.LLBLGen.Pro.LinqSupportClasses.DataSource2`1[gifter.api.model.EntityClasses.FacetEntity]).Where(facet => (facet.Id = value(gifter.repository.FacetService+<>c__DisplayClass6).facetId)).Select(facet => facet.RootFacetId).First()
Method Enter: CreatePagingSelectDQ
Method Enter: CreateSelectDQ
Method Enter: CreateSelectDQ
Method Exit: CreateSelectDQ
Method Exit: CreatePagingSelectDQ: no paging.
Method Enter: DataAccessAdapterBase.OpenConnection
Method Exit: DataAccessAdapterBase.OpenConnection
Method Enter: DataAccessAdapterBase.CloseConnection
Method Exit: DataAccessAdapterBase.CloseConnection
: Initial expression to process:
value(SD.LLBLGen.Pro.LinqSupportClasses.DataSource2`1[gifter.api.model.EntityClasses.FacetEntity]).Where(facet => (facet.RootFacetId = value(gifter.repository.FacetService).MetaData.Facet.Where(f => (f.Id = value(gifter.repository.FacetService+<>c__DisplayClass6).facetId)).Select(f => f.RootFacetId).First()))
Method Enter: DataAccessAdapterBase.FetchEntityCollection(8)
Method Enter: DataAccessAdapterBase.FetchEntityCollectionInternal(7)
Method Enter: CreatePagingSelectDQ
Method Enter: CreateSelectDQ
Method Enter: CreateSelectDQ
Method Exit: CreateSelectDQ
Method Exit: CreatePagingSelectDQ: no paging.
Method Enter: DataAccessAdapterBase.ExecuteMultiRowRetrievalQuery
Method Enter: DataAccessAdapterBase.OpenConnection
Method Exit: DataAccessAdapterBase.OpenConnection
Method Exit: DataAccessAdapterBase.ExecuteMultiRowRetrievalQuery
Method Exit: DataAccessAdapterBase.FetchEntityCollectionInternal(7)
Method Enter: DataAccessAdapterBase.CloseConnection
Method Exit: DataAccessAdapterBase.CloseConnection
Method Exit: DataAccessAdapterBase.FetchEntityCollection(8)
A first chance exception of type 'System.NullReferenceException' occurred in gifter.repository.DLL
There are 2 expressions here. The first works. The full method is:
public FacetEntity GetFacetTreeContainingFacetId(int facetId)
{
var selectedFacet = (from facet in MetaData.Facet
where facet.Id == facetId
select facet.RootFacetId).First();
var facetListTree = (from facet in MetaData.Facet
where facet.RootFacetId == (from f in MetaData.Facet
where f.Id == facetId
select f.RootFacetId).First()
select facet).ToList();
var rootFacet1 = facetListTree.IsNullOrEmpty()
? null : (from facet in facetListTree
where facet.Id == facetListTree[0].RootFacetId
select facet).First();
BuildTree(rootFacet1, facetListTree);
return rootFacet1;
}
We're looking at a tree node here, where the relevant fields are:
id - autogenerated id
parentId - the parent of the current node
rootId - the id of the rootnode of the tree
So this method accepts any node in the tree, and returns the root node of that tree, w/ all of the children populated.
There is no inheritance involved at this point.
Sorry for omitting this stuff from the beginning Frans, I should have read that post. That said, you may avoid some pain, if you name it something like: "REQUIRED INFORMATION FOR SUPPORT". Just a thought.
Thanks