How to Generate WCF proxy with Generic List object RRS feed

  • Question

  • User-386954757 posted


    How to Generate WCF proxy with Generic List object

    Monday, October 21, 2013 5:26 AM


All replies

  • User-488622176 posted

    What do you mean? A generic list of a specific object type (ex: List<Person>) or a List<T> ?

    Monday, October 21, 2013 8:08 AM
  • User-386954757 posted

    Yes Correct,

    Even i tried with svcutil  but it  generate c# file with ARRAY collection [], I want LIST 

    Monday, October 21, 2013 9:29 AM
  • User-742633084 posted

    Hi atulthummar,

    When you creating WCF client proxy (either via Add ServiceReference or svcutil.exe), it use Array type for collection classes (defined in service Contract) by default. To change the behavior, you can specify "collection type" either in the "Advanced..." option setting of Add ServiceReference dialog:

    #Configure Service Reference Dialog Box

    or use the "/collecitonType" (/ct) option of svcutil.exe tool:

    #ServiceModel Metadata Utility Tool (Svcutil.exe)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 21, 2013 11:23 PM