views:

484

answers:

3

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.

-

A: 

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

Janie
+1  A: 

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

Zyphrax
when i use [DataContract] atribute i receive this error:Error 1 The type or namespace name 'DataContractAttribute' could not be found (are you missing a using directive or an assembly reference?) D:\Source\SCI4\SCI4WebService\Class1.cs
CrazyJoe
Be sure to include System.Runtime.Serialization in your using directives.
Zyphrax
A: 

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.

John Saunders