WCF: DataContract + ServiceContract
Hi,
It's not possible to create a class with the [ServiceContract] attribute that have some property with the [DataMember] attribute?
It's not possible to create a class with the [DataContract] attribute that have some function with the [OperationContract] attribute?
It's not possible to create a class with the [DataContract] and [ServiceContract] attributes?
With this model I need to divide functions and datas. How can i adapt your SOA model to my OOP mind?
Thank you.
[ServiceContract(SessionMode =SessionMode.Required)]
publicclassDoubleValidator
{
private Validators.DoubleValidator m_val;
[OperationContract]
publicvoidConstructor(string val)
{
m_val =new Validators.DoubleValidator(val);
}
[OperationContract]
publicbool IsValid()
{
return true;
}
}
And not:
[ServiceContract(SessionMode =SessionMode.Required)]
publicclassDoubleValidator
{
private Alexey.Data.Validators.DoubleValidator m_val;
[OperationContract]
publicDoubleValidator(string val)
{
m_val =new Validators.DoubleValidator(val);
}
[DataMember]
publicboolIsValid
{
get{ return true; }
}
}

