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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:06:06+00:00 2026-06-03T15:06:06+00:00

I have a C# class defined as follows: public class GenericItem<T> { public List<T>

  • 0

I have a C# class defined as follows:

public class GenericItem<T>
{
  public List<T> Items { get; set; }

  public DateTime TimeStamp { get; set; }
} 

I am creating an instance of this class on my server. I am then trying to pass it over the wire via a WCF service as shown here:

[OperationContract]
public GenericItem<MyCustomType> GetResult()
{
  GenericItem<MyCustomType> result = BuildGenericItem();
  return result;
}

Everything compiles just fine at this point. When I “update service reference” in my Silverlight app an re-compile, I receive a compile-time error, similar to the following:

MyNamespace.GenericItemOfMyCustomType[extra chars] does not contain a public definition for ‘GetEnumerator’

I have no idea why:

  1. Extra chars are appearing. The seem to change everytime I update the service reference.
  2. How to actually fix this.

What am I doing wrong?

  • 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-06-03T15:06:08+00:00Added an answer on June 3, 2026 at 3:06 pm

    Sleiman is correct, but one can use Bounded Generics as described in this article, and you may be able to achieve what you want. This allows you to create a generic type within the service and expose it. But the consumer will not view it as generic as the type is specified in the service operation.

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

Sidebar

Related Questions

I have a List<CustomClass> listOfCustomClass . CustomClass is defined as follows : public class
I have a user control with a property defined as follows: public partial class
I have a model defined as follows: public class Link extends Model { @Required
I have a View Model that is defined as follows: public class VariableViewModel {
I have a class defined as follows... public class df { String dt; String
I have some public variables that are defined as follows: public class FieldsToMonitor {
If you have a base class defined as follows: public abstract class BaseMessageObject<T> where
I have a class defined as follows interface ITest { List<T> Find<T>(int i); }
I have defined a type as follows: public class myType { public string firstName
I have a Software titles class which is defined as follows: public class SoftwareTitles

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.