We are enforcing all our domain objects to implement GetHashCode.
namespace Core
{
[Serializable]
public abstract class DomainObject
{
public abstract override int GetHashCode();
}
}
namespace Entity.Domain
{
[Serializable]
[DataContract]
public partial class IdCard : DomainObject
{
private System.Int32 _effDte;
[DataMember]
public virtual System.Int32 EffDte
{
get { return _effDte; }
set { _effDte = value; }
}
public override int GetHashCode()
{
return EffDte.GetHashCode();
}
}
}
When we expose these domain objects through WCF, the following generated service is requiring a post-update modification to compile.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace IdCardManagerServiceReference {
using System.Runtime.Serialization;
using System;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="IdCard", Namespace="http://schemas.datacontract.org/2004/07/Entity.Domain")]
[System.SerializableAttribute()]
public partial class IdCard : Core.DomainObject, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
[System.NonSerializedAttribute()]
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private int EffDteField;
[global::System.ComponentModel.BrowsableAttribute(false)]
public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
get {
return this.extensionDataField;
}
set {
this.extensionDataField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public int EffDte {
get {
return this.EffDteField;
}
set {
if ((this.EffDteField.Equals(value) != true)) {
this.EffDteField = value;
this.RaisePropertyChanged("EffDte");
}
}
}
}
Any ideas on how to keep the requirement for GetHashCode, but remove the requirement for any code on the client (as an update or as partial classes)?