How to avoid conflicts when using services? (.NET C#) -


itemprop = "text">

Imagine this class

  namespace CommonLibrary {public square report () {public Start Date Time {Get; Set; } Public int count {get; Set; }}}  

This is the return type of a WCF service method. When I use svcutil.exe it re-creates the square from the metadata:

  Name space CommonLibrary {[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.Runtime.Serialization", "3.0. 0.0 ")] [System.Runtime.Serialization.DataContractAttribute (name =" TrafficProblemReport ", namespace =" http://schemas.datacontract.org/2004/07/Indica ")] Public partial class TrafficProblemReport: Object, System. Runtime.Serialization.IExtensibleDataObject {Private Systems. time to time. Serialization. ExtensionData Object ExtensionData field; Private Systems DateTime Startfield; Private integer calculation field; [System.Runtime.Serialization.DataMemberAttribute ()] Public System.DateTime start {{get it. BackField Return; } Set {this.BeginField = value; }} [System.Runtime.Serialization.DataMemberAttribute ()] Public int calculation {get {return this.CountField; } Set {this.CountField = value; }}}}  

But it conflicts with common library definitions I am having compilation errors when I pass the Web Service Method (Report) for the method of a CommonLibrary Try:

There is some such invalid argument in error 4 'GoodLoader Method Match (CommonLibrary.Report) for CommonLibrary.ClassName.MethodName

this How to solve without creating additional namespace ? (I want to avoid type conversion)

I could not find the time to try right now , But do / switch switches?

According to this I must be correct:

I think svcutil uses the type in the assembly instead of creating a new assembly ... < / P>


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -