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 144073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:11:44+00:00 2026-05-11T08:11:44+00:00

I’m confused. I’ve got a Silverlight project that currently runs and displays a list

  • 0

I’m confused. I’ve got a Silverlight project that currently runs and displays a list of servers from my mocked model (I am following the MVVM pattern).

The interface is coded as follows:

public class GetServersCompletedEventArgs : EventArgs  {     public Exception Error {get; set;}     public IEnumerable<LicenseServer> Results {get; private set;}      public GetServersCompletedEventArgs(Exception error, IEnumerable<LicenseServer> results)     {         this.Error = error;         this.Results = results;     } }  public delegate void GetServersCompletedEvent(GetServersCompletedEventArgs e);  public interface IDataService {     void GetServers();      event GetServersCompletedEvent GetServersCompleted; } 

As you can see the CompletedEventArgs return the results as a IEnumerable.

The problem that I am having is defining <LicenseServer> in such a way that I can stub it with fake data or populate the results from real data (ala ado.net data services).

I’ve created a local class LicenseServer but the service always returns a different type of LicenseServer.

I get an error:

convert Unable to cast object of type ‘DataServiceOrderedQuery[LicenseMon.LMonServiceReference.License_Server]’ to type ‘System.Data.Services.Client.DataServiceQuery`1[LicenseMon.Model.LicenseServer]

Which I read as LicenseServer from the service reference cannot be converted over to the LicenseServer I’ve defined in my model class

Why am I having trouble? Shouldn’t I be able to develop my classes independently and be able to switch between a live database and my internally generated data? Am I approaching this the wrong way?

Any code samples, explanations, links etc would be most helpful

  • 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. 2026-05-11T08:11:45+00:00Added an answer on May 11, 2026 at 8:11 am

    Often, when consuming a web resource (SOAP, WCF or ADO.NET Data Services), a separate client proxy class is generated. This will have similar layout, but has no automatic conversion to your local type. Some systems support type re-use (WCF etc), but not all.

    You could add a conversion or an interface to the partial class; but in general, you should treat this as a separate type.

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

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

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.