adding a event to domain service class?

443 views Asked by At

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 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 ?

2

There are 2 answers

1
Davita On BEST ANSWER

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

1
Chris Moutray On

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