CSLA 4.10: Csla.DataPortalClient.LocalProxy Error

CSLA 4.10: Csla.DataPortalClient.LocalProxy Error

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


hramos360 posted on Wednesday, April 27, 2011

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?

 

 

RockfordLhotka replied on Wednesday, April 27, 2011

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.

hramos360 replied on Wednesday, April 27, 2011

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