Adding Criteria to NameValueList

Adding Criteria to NameValueList

Old forum URL: forums.lhotka.net/forums/t/207.aspx


Norma_B posted on Friday, May 26, 2006

I'm just coming to VS.NET from VB6, and have a (newb) question: I need to retrieve a filtered list into an class that inherits NameValueListBase. When I add the Private Criteria class, I get the following error: "class 'Criteria' conflicts with class 'Criteria' in the base class 'NameValueListBase' and should be declared  Shadows'." The compiler likes it when I add Shadows to the declaration, but then the code doesn't work at run-time. I'm working around this by passing the filter value into the Shared function which returns the list (which then stores the filter value in a Shared variable), but that seems inelegant and against the 'spirit' of CSLA. I'd be much obliged if somebody could tell me what I'm missing.

RockfordLhotka replied on Friday, May 26, 2006

Just use another name for your criteria class - like FilteredCriteria. That way you avoid the naming collision and it should work just fine.

Norma_B replied on Friday, May 26, 2006

*ahem* d'oh!

Thanks!

updated to add: Yep, that did it. Um, thanks some more!

Plowking replied on Thursday, February 08, 2007

Thread with example solution to this problem, hope it's of help to someone...

http://forums.lhotka.net/forums/thread/2369.aspx

Copyright (c) Marimer LLC