问题描述
此MSDN文章建议始终为ServiceContract和DataContract提供名称空间. /p>
示例通常具有模式"前缀和名称空间(例如
)的URI类型模式 Namespace="urn:WCFEssentials/Samples/2008/12"
代替带有点标记(例如
)的传统C#名称空间 Namespace="MyNamespace.MyDataClasses"
命名空间属性的建议格式是什么?我们需要模式前缀吗?为什么建议使用这种格式?
这是一个 XML命名空间 .可以是urn:
格式,也可以是URL.
This MSDN article recommends always to provide a namespace to a ServiceContract and DataContract.
Examples usually have a "schema" prefix and a URI type pattern for the namespace such as
Namespace="urn:WCFEssentials/Samples/2008/12"
instead of a traditional C# namespace with dot-notation such as
Namespace="MyNamespace.MyDataClasses"
What is the suggested format the namespace property? Do we need the schema prefix? Why is this format suggested?
It's an XML Namespace. Those can either be in the urn:
format or they can be URLs.
这篇关于DataContractAttribute.Namespace属性的格式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!