Error in C# Book

Error in C# Book

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


DanEssin posted on Monday, June 05, 2006

On page 402 there is a code snippet:

public  static NameValueList GetNameValueList()
{
       return = DataPortal.Fetch<NameValueList>(new Criteria(typeof(NameValueList)));
}

It seems likely that the = is a leftover from a VB method.

RockfordLhotka replied on Monday, June 05, 2006

No, that's just a simple typo. The VB code from the equivalent page is

Return DataPortal.Fetch(Of NameValueList)(New Criteria(GetType(NameValueList)))

same as the C# code really.

Thanks for pointing this out, I'll add it to the errata page.

Copyright (c) Marimer LLC