开发者

adding a event to domain service class?

开发者 https://www.devze.com 2023-02-11 23:12 出处:网络
Is it possible to add a event to the domain service class? I have a method which has to check about 1000 records in the database for something and I wish to do this in the domain开发者_StackOverflow中

Is it possible to add a event to the domain service class?

I have a method which has to check about 1000 records in the database for something and I wish to do this in the domain开发者_StackOverflow中文版 service since it seems a bit useless to load all the data from server side to client side and from client side send it back to server side to be processed by a Stored Procedure.

So to still be able to show the user at what point of the process it is I would like to have a event that I can call on client side which shows the current record it is processing (asin a number).

I've tried using the only way I know:

public delegate void CalculateMemberCompleted(int i);
public event CalculateMemberCompleted CalculateRenewed;

but this doesn't seem to work as I can't access it by using "Context.CalculateRenewed" in the viewmodel. Anyone got any idea on how to accomplish what I want ?


Unfortunatelly it's not possible to access domain service's event from silverlight, but you can still use wcf duplex services, so the server will be able to send data to silverlight, without a request from the client, isn't it what you want? Take a look here and here


You could use Silverlight Reactive Extensions (Rx). Sorry to be so vague but I haven't used this myself yet.

0

精彩评论

暂无评论...
验证码 换一张
取 消