Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6014533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:42:21+00:00 2026-05-23T02:42:21+00:00

There is a WCF service: public List<Aktivy> Aktivy() { DataClassesDataContext db = new DataClassesDataContext();

  • 0

There is a WCF service:

    public List<Aktivy> Aktivy()
    {
        DataClassesDataContext db = new DataClassesDataContext();
        var aktivy = from akt in db.Aktivys
                     select aktivy;
        return aktivy.ToList();
    }

Also there is a Silverlight client that accesses the WCF service:

    private void Grid_Loaded(object sender, System.Windows.RoutedEventArgs e)
    {
        ServiceReference.ServiceClient webService = new ServiceReference.ServiceClient();
        webService.AktivyCompleted += new EventHandler<ServiceReference.AktivyCompletedEventArgs>(webService_AktivyCompleted);
        webService.AktivyAsync();
    }

    void webService_AktivyCompleted(object sender, ServiceReference.AktivyCompletedEventArgs e)
    {            

    }

How to convert e.Result (which features webService_AktivyCompleted) in the List<Aktivy> on the client side?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:42:22+00:00Added an answer on May 23, 2026 at 2:42 am

    By default when you configure a service reference in Silverlight the collection types are set to deserialise into ObservableCollection<T> (which is not a List<T>). If you always want a simple List<T> you can modify the configuration of the service reference (right mouse on the service in Solution Explorer) and set collections to be represented as List<T>.

    However a better approach when dealing with these things is to work with interfaces instead of demanding a specific type. Modify your code to work with IList<T> (a ObservableCollection<T> implements IList<T>) instead of List<T>, this will work with any of the possible collection types that a service may be configured for.

    Since ObservableCollection<T> is the most versatile of the available choices you would have to have a good reason why the collection must be List<T>. One reason might be because you are sharing code between server and client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My WCF service exposes this function public SerialNumberInfo GetSerialNumberInfo(string serialNumber) { } Is there
i created a wcf service that had a method: public List<Mail> GetMailItems() { //gets
I have a WCF service. It has a following attributes. [DataMember] public List<uttAppointmentPhoneList> AppointmentPhoneList
I have classes generated from a WCF soap service. public partial class Job {
There is a WCF service that I was using and now it is pointing
There is a WCF REST service hosted in Windows Service or in command line
Is there any way to replace the WCF service application built-in JavascriptSerializer with Newtonsoft
Is there a way to host wcf service application with Plesk Panel 9.2 in
When invoking a WCF service asynchronous there seems to be two ways it can
Is there a clever way to structure my WCF service, such that I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.