CSLA .NET

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

CSLA Silverlight CommandBase usage?

rated by 0 users
Not Answered This post has 0 verified answers | 1 Reply | 2 Followers

Top 150 Contributor
60 Posts
Ranjini posted on Fri, Oct 1 2010 10:31 AM

Are there any good example projects that show usage of a CommandBase object in Silverlight ?

 We are using Silverlight 4 / CSLA 4 and have a usecase where we need some operations/calculations performed within a business object that do not qualify as any of the CRUD operations. We figured CommandBase would be the right way to do this, but we are unable to find any good examples to get this to work. We tried using a Rule to trigger the DataPortal_Execute but may be because the affectedproperty is a BLB, it doesnt seem to work. Any pointers, please?

Thanks

Ranjini

Ranjini Suryanarayanan

All Replies

Top 10 Contributor
9,270 Posts

Remember that all server access is async, which means that invoking a command object is also async, which means that you must do this from within an async rule.

In the rule's Execute method you need to run the command, and handle the command's completion callback, and in that callback handler you need to call context.Complete to tell the rule that it is done.

I think this is demonstrated in the SimpleApp demo, though maybe with a ROB instead of CB - but the implementation is basically the same.

Rocky

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