CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

StackoverflowException with dynamics in NameValueListBase Dataportal_Fetch

rated by 0 users
Not Answered This post has 0 verified answers | 1 Reply | 0 Followers

Top 150 Contributor
53 Posts
shawndewet posted on Tue, Jun 12 2012 1:33 AM

I've still gotta figure out exactly how to debug this, but it seems there is a problem resulting in a StackoverflowException in NameValueListBase when utilizing Massive (the micro ORM by Rob Conery) to extract the data out of the database.

Basically what happens is this...

List<dynamic> list = tableAccessor.FetchAll();

foreach(dynamic item in list)

 Add(new NameValuePair(item.Code, item.Name)); --> this line results in a StackoverflowException.

 

If I change my code to this...

 

List<dynamic> list = tableAccessor.FetchAll();

string code = "";

string name = "";

foreach(dynamic item in list){

  code = item.Code; --> this line results in a StackoverflowException.

  name = item.Name;

 Add(new NameValuePair(code, name)); 

 

}

Interestingly, if I put a breakpoint on the faulting line, and use the Watch window to peak into the dynamic object, then the Code and Name properties are indeed there as expected.

It should be noted that in other stereotypes (like ReadonlyListBase, BusinessListBase, etc) I use the exact same approach to extract data from the database and it works fine.

So to work around the problem, I have replaced my use of NameValueListBase with ReadOnlyListBase.

(I'm using CSLA 4.3.10).

All Replies

Top 150 Contributor
53 Posts

what I can't fathom is why the same line of code would run fine in the DataPortal_Fetch of other stereotypes, but runs into a StackoverflowException when run in the DataPortal_Fetch of NameValueListBase.  Does this make sense to anybody out there?

Page 1 of 1 (2 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems