DataMember.Code scope
For the Code member on the DataMember attribute:
Does Code need to be globally unique (as it is in the ParameterCode enum), or does it work like a typical contract id as in protobuf etc?
In other words, is the following example OK or is it a problem for both A.Field and B.Field to have the same parameter code?
[DataMember(Code = (byte)ParameterCode.InterestAreaId)] public byte InterestAreaId { get; set; }
Does Code need to be globally unique (as it is in the ParameterCode enum), or does it work like a typical contract id as in protobuf etc?
In other words, is the following example OK or is it a problem for both A.Field and B.Field to have the same parameter code?
class A : DataContract { [DataMember( Code = 0 )] public int Field { get; set; } } class B : DataContract { [DataMember( Code = 0 )] public int Field { get; set; } }
0
Comments
-
Sorry for the late reaction. I'll get a "server" colleague to answer that asap.0
-
The code does not need to be globally unique. It only must be unique within the DataContract.0
-
Parameter codes also don't have to be globally unique, but only unique per operation/event.0