I'm following the CSLA4 "Data Access" ebook where on Page 6, I copied the code for an asynchronous DataPortal_Fetch as follows:
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public void DataPortal_Fetch(FirePropertyListCriteria criteria, Csla.DataPortalClient.LocalProxy<FirePropertyList>.CompletedHandler handler)
{
try
{
handler(this, null);
}
catch(Exception ex)
{
handler(null, ex);
}
}
My code will not compile giving the following error:
public void DataPortal_Fetch(FirePropertyListCriteria criteria, Csla.DataPortalClient.LocalProxy<FirePropertyList>.CompletedHandler handler)
The non-generic type 'Csla.DataPortalClient.LocalProxy' can not be used with type arguments.
Am I missing a reference or something?
Is that code in a compiler block:
#if SILVERLIGHT
#endif
That code is only relevant to Silverlight, and won't compile on the .NET side.
I did not have the #if SILVERLIGHT directive block. This works now. I was just following the code snippet from the book which doesn't contain the directive.
Thanks Rocky.
Copyright (c) Marimer LLC