为什么我得到 WCFTestClient 不支持的操作,因为它的类型是 ...?(见截图)
类似的方法适用于普通的普通合同,但不适用于引用实体框架类的合同
有两个响应数据合同。
纯数据合约
[DataContract] 公共类 GetSomeResponseDataContract { 私人收藏 myFund;
[DataMember] public Collection<MyFund> MyFund { Get { } }
}
MyFund 在哪里
[DataContract]
public class MyFund
{
[DataMember]
public string FundCode { get; set; }
[DataMember]
public string FundName { get; set; }
.
.
}
EntityDataContract 的数据契约
[DataContract] 公共类 GetYoursResponseDataContract { 私人收藏 yourFund;
[DataMember] public Collection<YoursFund> YourFund { Get { } } }
YourFund 在哪里
[EdmEntityTypeAttribute(NamespaceName="RModel1", Name="YoursFund")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class YoursFund : EntityObject
{
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String FundCode
{
get
{
return _FundCode;
}
set
{
OnFundCodeChanging(value);
ReportPropertyChanging("FundCode");
_FundCode = StructuralObject.SetValidValue(value, false);
ReportPropertyChanged("FundCode");
OnFundCodeChanged();
}
}
}