Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

Linq to SQL with CSLA - Property evaluation failed error when passing parent object to child

$
0
0

I have a business object with 20+ properties.  And child having 15+ properties which is a Businesslistbase.  I require the Root object property values in updating some child property values. 

When I use linq to sql and pass the root object in the Dataportal_Update() method like below

 <Transactional(TransactionalTypes.TransactionScope)> _

  Protected Overrides Sub DataPortal_Update()

       Using ctx = ContextManager(Of DalLinq.DartDBDataContext).GetManager(connection, False)

              ctx.datacontext.Root.updateRootStoredProcedure( propertvalue1, propertyvalue2, 3, 4 .....)

              Fieldmanager.UpdateChildren(me)

       End using.

End sub

and in the Child_Update() method in the child object I can not read the values of the Root object. 

It gives the error like "property evaluation failed " 

"Cannot evaluate expression because we are stopped in a place where garbage collection is impossible"

Is there a way to solve this problem?

But If I take out the using statements and linq update methods at both Root and Child,

and just used the FieldManager.UpdateChildren(me)  method ,  I can read the root object values inside the Child_Update method.

 

 

 

 

 


 


Viewing all articles
Browse latest Browse all 764

Trending Articles