Solved

Silverlight, RIA services

Posted on 2010-09-09
2
918 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 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

16 Experts available now in Live!

Get 1:1 Help Now