Why we cant return List in ASMX web services?

前端 未结 5 2017
忘掉有多难
忘掉有多难 2021-01-06 10:09

As developers know we cant return List with web services, we can only return lists with converting them to .ToArray(); I\'ve searched some, but cant ge

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-06 10:38

    As far as I am aware as long as you explicitly declare you are returning a List (of T) method title you can return the object; otherwise you will receive a serialize error.

    e.g

     _
    Public Function Search(ByVal SearchTerm As String) As List(Of 'object here')
    

提交回复
热议问题