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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:31:10+00:00 2026-05-11T14:31:10+00:00

Background: I have a big solution where hundreds of functions take strongly typed collections

  • 0

Background:

I have a big solution where hundreds of functions take strongly typed collections as inparameters and using them as return values.

The solution references a generated proxy wich converts calls to a webservice that always returns collection in the format int[] or Order[] or wathever type it is. The proxy wraps them up as IntCollection or OrderCollection.

Now I want to reference the assembly directly. When I do that I get the interface against the Arrays instead of the proxy generated strongly typed collections. This of course breaks all the code.

I am looking for a smart way to handle this and avoid rewriting thousands lines of code.

Any ideas?

  • 1 1 Answer
  • 2 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-11T14:31:11+00:00Added an answer on May 11, 2026 at 2:31 pm

    Does IntCollection etc belong to you? You could add an implicit conversion operator:

    class IntCollection : Collection<int> {     public IntCollection() : base() { }     public IntCollection(IList<int> data) : base(data) { }     public static implicit operator int[](IntCollection items) {         return items.ToArray(); // LINQ, but can do manually     }     public static implicit operator IntCollection (int[] items){          return new IntCollection(items);     } } 

    Normally, this would be one of the times that interfaces (IList<Foo> etc) help – but interfaces don’t often work very well in web services. Depending on what the code currently does, you might be able to do a ‘replace all’ fix – a bit drastic, though; other than that… you’re going to have to change odd bits of code.

    a few thoughts:

    • switching to var (in C# 3.0) might minimize the change – i.e. var orders = svc.GetOrders(); in most cases, the different implementations will have ‘similar enough’ APIs
      • resharper might be able to help with this
    • using LINQ (.ToList(), .ToArray()) might serve as a shim
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a big div with a big background-image. Now I want to create
I have a big <div /> container that has an image as a background.
I have a problem I can't seem to fix. I have a big background
i have a script that creates divs with some background image then moves them,
I have a big image that has to go in the background. Say the
I have pretty big background of .net, and I've decided that i want to
I have a big background image with x1600 width. It suit perfectly in 1600x900
I have the following layout: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:background=@drawable/aussie_bg_big > <ImageView android:id=@+id/titleImage android:layout_width=wrap_content
Background: I have an MVC based polaroid object. The model keeps the photo's metadata,
Background I have an array of objects (Users) defined and set as follows: //

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.