Silverlight, RIA services

Posted on 2010-09-09
Last Modified: 2013-11-12

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
Question by:RTSol
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 29

Accepted Solution

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.

Author Closing Comment

ID: 33652464

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

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

and it works fine.

Best regards

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

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 88
Blending HTML output from R Studio into a ASP.Net/C# project 4 53
Shared Service Environment 2 55
What is GIS method of Geometry data type? 6 36
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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.…

752 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