Solved

Silverlight, RIA services

Posted on 2010-09-09
2
916 Views
Last Modified: 2013-11-12
Hi,

I have a Silverlight application and want to use RIA services to retrieve some data from the login account. I have added the following method to the AuthenticationDomainService class:

        public string[] getRoles()
        {
            string usr = Membership.GetUser().UserName;
            string[] rol = Roles.GetRolesForUser(usr);
            return rol;
        }

which however gives the build error

Type 'String' is not a valid entity type.  Entity types cannot be a primitive type or a simple type like string or Guid.

How can I correct this?
Is there a better way to work with the user data from Silverlight?

Best regards
RTSol
0
Comment
Question by:RTSol
2 Comments
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 33646451
can you post the RIA service code. it look like you are trying to add a domain Operation , which needs an entity as a return type.
PLease put the attribute [ServiceOperation] on your method and it should work.
0
 

Author Closing Comment

by:RTSol
ID: 33652464
Hi,

Thanks for the tip. It found that the attribute [ServiceOperation] has been replaced by [Invoke]. My code now looks like this:

        [Invoke]
        public string[] getRoles()
        {
            string usr = Membership.GetUser().UserName;
            string[] rol = Roles.GetRolesForUser(usr);
            return rol;
        }

and it works fine.

Best regards
RTSol
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now