Web サービスに次の 2 つのクラスがあります。
[DataContract]
public class AllFile
{
[DataMember(IsRequired = true)]
public virtual string base64Data { get; set; }
}
[DataContract]
public class UploadFile : AllFile
{
[DataMember(IsRequired = true)]
public string data;
[DataMember(IsRequired = true)]
public override string base64Data { get { return data; } set { data = value; } }
}
ServiceReference.UploadFile obj = new ServiceReference.UploadFile();
obj.base64Data = "something";
AllFile file = (UploadFile)obj;
However, it tells me that file.base64Data is null. Why? I thought I overrided the sub class already.