views:

19

answers:

1

Hello!

I'm using WCF RIA + Silverlight 4.0 in my project.

On client and server side I need to check (via validation process) if collection (e.g. Orders) that belongs to e.g. Manager is filled or not. The rule is that at least one Order should be there otherwise validation failed. Orders are loaded together with Manager via [Include] attribute so on client side i have all orders available. I created Custom validator and check if collection is null or empty.

Problem - on client side after domainDataSource.Submit() in custom validator i can see orders loaded but after that there is another check - on SERVER side and there is no any Order in collection so this check is never passes.

What is the correct way to check collection - is it empty or not?

Thanks in advance!

P.S. - it seems like i have to separate validation process with #if SILVERLIGHT ... #else ... #endif directives and on server side load all Orders from DB and check it this way. But it seems a 'bit' wrong to check it this way...

A: 

On the server side you have to control the orders number checking also the database, because the server will receive only new orders if something has been changed....

Francesco Abbruzzese