Tipo complejo y SilverLight y WCF RIA: ¿la forma más fácil?

I try to operate with WCF RIA + SilverLight (Entity FrameWork + DomainService) On SQL server I have three tables:

usuarios idName idUser

usersStatus idStatus idUser

usersJobs idJobs idUser

So, I have three entities on server/client-side. Is there a way to get all three entities at once, in one object?

I want to do it by Domain Service side, by LINQ (not at SQL Server)?

I tried to create specail proxy-class, but feel trouble to create an instance. Field of proxy-class define in metadata - so I can not get access to it.

I want for example something like that:

public partial class proxyUser
{
internal sealed class proxyUserMetadata
    {

        // Metadata classes are not meant to be instantiated.
        private proxyUserMetadata()
        {
        }

        public users user { get; set; }

        public usersStatus status{ get; set; }

        public EntityCollection <usersJobs> jobs { get; set; }
    }
}

Is there easy way? Thanks.

preguntado el 08 de noviembre de 11 a las 14:11

1 Respuestas

You can create new class to wrap entities you want to return to client.

public class CustomEntity
{
    [Key]
    public Users User { get; set; }
    public UserStatus Status { get; set; }
    public List<UserJobs> Jobs { get; set; }
}

respondido 08 nov., 11:18

I would move the userId out as a separate property and make it the key. It seems everything is bound to it anyway. - Danexxtone

@Danexxtone I totally agree with you, in fact it'd be easy if this guy use ASPNetMembership but I don't know about the design decision so I leave it out there. - Ekk

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.