CSLA .NET

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

Breaking change problems between MethodCaller and Silverlight FactoryProxy CSLA 4.3

rated by 0 users
Answered (Verified) This post has 1 verified answer | 3 Replies | 1 Follower

Top 500 Contributor
27 Posts
csmith1 posted on Thu, Apr 5 2012 8:40 AM

Silverlight is calling the MethodCaller with a handler to a CompletedHandler.

See FactoryProxy call below.

MethodCaller.CallMethod(command, _attribute.ExecuteMethodName, handler);

 

This actually calls line below in the MethodCaller.

CallMethod(object obj, string method, params object[] parameters)

The CompletedHandler is now a parameter. I do not see a CallMethod.
This causes multiple problems. One is CompletedHandler is never called. Some functions are never found.
I have changed my FactoryProxy is look like this.
try
        {
            var result =  MethodCaller.CallMethod(obj, _attribute.FetchMethodName, criteria);
            if ((result != null) && (result is T))
              {
                  handler((T)result, null);
              }
              else
              {
                  throw new NullReferenceException();
              }
          }
          catch (Exception ex)
          {
              T empty = default(T);
              handler(empty, ex);
          }

Answered (Verified) Verified Answer

Top 10 Contributor
1,770 Posts
Verified by csmith1

If you use localproxy in Silverlight you should have metods that has a CallbackHandler as last parameter. 

This is because the data access is asyncronous in Silverlight so the async data access (websevice?) must call the async callback handler. 

Jonny Bekkum, Norway CslaContrib Coordinator

All Replies

Top 10 Contributor
1,770 Posts
Verified by csmith1

If you use localproxy in Silverlight you should have metods that has a CallbackHandler as last parameter. 

This is because the data access is asyncronous in Silverlight so the async data access (websevice?) must call the async callback handler. 

Jonny Bekkum, Norway CslaContrib Coordinator

Top 500 Contributor
27 Posts

Thanks,

I found it in Using CSLA document.

That just made the Mock DAL twice as complicated.

 

 

Top 500 Contributor
27 Posts

 I had to use Csla.DataPortalClient.FactoryProxy instead of LocalProxy for the handler.

 

 

Page 1 of 1 (4 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