基本上,当返回一个YoyoData
类型的对象时,下面的代码是否应该起作用并序列化string Yoyo
。
public interface IHelloV1
{
#region Instance Properties
[DataMember(Name = "Yoyo")]
string Yoyo { get; set; }
#endregion
}
[DataContract(Name = "YoyoData", Namespace = "http://hello.com/1/IHelloV1")]
public class YoyoData : IHelloV1
{
string Yoyo { get; set; }
public YoyoData()
{
Yoyo = "whatever";
}
}
}