locked
How to Generate WCF proxy with Generic List object RRS feed

  • Question

  • User-386954757 posted

    Hello,

    How to Generate WCF proxy with Generic List object

    Monday, October 21, 2013 5:26 AM

Answers

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
    http://msdn.microsoft.com/en-us/library/bb514724(v=vs.110).aspx

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

    #ServiceModel Metadata Utility Tool (Svcutil.exe)
    http://msdn.microsoft.com/en-us/library/aa347733(v=vs.100).aspx

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