Client will get a 400 Bad Request response when the return type from the method signature does not match the type of the returned result.

For example,

public Object DoWork()

{

return 12;

}

 

Why IEnumerable<T> cannot be used as the return type?

Because IEnumerable (and other interfaces) are not expressible in XML schema. Using a concrete type works fine in this case.

相关文章:

  • 2022-12-23
  • 2021-05-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2021-07-19
  • 2021-12-24
  • 2022-01-01
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案