JoeLoco
JoeLoco

Reputation: 2204

How to return Domain objects from a WebService to my SilverLight Application

Im my DDD Aplication I have a lot of Domain Objects like date:

class User()
{
    public String Name{get;set;}
}

The persistence of then already done!

Now im going to Client Side (SilverLight).

My problem is: how i work with a User object on Client Side.

Example:

// only a example
User user = Service.Login("crazyjoe","1234");

The User object do not exist on Client Side.

Question:

Have a clean and fast way to pass my User object to SilverLight??

Obs: clean = dont put anything on my User class.

-

Upvotes: 0

Views: 1112

Answers (3)

John Saunders
John Saunders

Reputation: 161773

This isn't a problem. The User object you use on the client side will not be the same as the one on the server, but it will have all the same properties, of the same or similar types. It will be a proxy class. Note that it will be in a different namespace. If your Service Reference is named "UserService", then it will be in that namespace.

Upvotes: 0

Yvo
Yvo

Reputation: 19263

This website should give you the information you need:
Silverlight 2 - Webservices Part II - User defined type

Upvotes: 1

Janie
Janie

Reputation: 1933

I would use WCF to push the data to the silverlight client.

Upvotes: 0

Related Questions