我有一个WCF服务。 在我的移动应用程序中,我生成了一个Web引用。
我注意到,对于某些字段,它还会生成myFieldSpecified bool。 例如,我有一个包含int数量的类Quantity。 在移动端,它还生成一个bool quantitySpecified 。
这个指定领域的目的是什么?
I have a WCF service. And in my mobile application I generated a Web References.
I notice that for some fields it also generates a myFieldSpecified bool. For example, i have a class Quantity that contains an int quantity. on the mobile side it also generates a bool quantitySpecified.
What is the purpose of this specified field?
最满意答案
如果数量字段未在服务上标记为必需,则会发生这种情况。 服务描述比使用该字段为可空和web引用将可空类型划分为非可空和bool,即如果指定了字段则说明。
This happens if quantity field is not marked as required on the service. Service description than uses this field as nullable and web reference divide the nullable type into non nullable and bool which is saying if field was specified.
更多推荐
发布评论