【发布时间】:2020-07-03 20:53:26
【问题描述】:
当使用 Micrsoft RestClient 生成 WebApi 时,需要考虑许多规则,例如,您需要将所有 ValueType(如 int 或 System.Guid)标记为 System.ComponentModel.DataAnnotations.RequiredAttribute,否则 AutoRest 会生成它们System.Nullable<T> 在生成的代码中。
但是我该如何做才能保留List<int> 和List<int> 而不是List<int?>?在这种情况下,使用[Required]没有任何帮助。
【问题讨论】:
标签: c# asp.net-web-api autorest