Solved

Silverlight, RIA services

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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