我正在創建一個基於SOA的應用程序,我已經使用Framework 4.0創建了WCF服務項目,因爲我在WCF操作中使用實體框架合同方法我正在使用類由EF生成的,但WCF不能識別這些對象,當我在設計模式下檢查這些類,它們就像在WCF中使用EF實體類
[EdmEntityTypeAttribute(NamespaceName="quizTestDBModel", Name="tbl_adminUser")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class tbl_adminUser : EntityObject
{
#region Factory Method
/// <summary>
/// Create a new tbl_adminUser object.
/// </summary>
/// <param name="adminUserId">Initial value of the adminUserId property.</param>
public static tbl_adminUser Createtbl_adminUser(global::System.Int32 adminUserId, global::System.String name, global::System.String userid, global::System.String password)
{
tbl_adminUser tbl_adminUser = new tbl_adminUser();
tbl_adminUser.adminUserId = adminUserId;
return tbl_adminUser;
}
#endregion
#region Primitive Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Int32 adminUserId
{
get
{
return _adminUserId;
}
set
{
if (_adminUserId != value)
{
OnadminUserIdChanging(value);
ReportPropertyChanging("adminUserId");
_adminUserId = StructuralObject.SetValidValue(value);
ReportPropertyChanged("adminUserId");
OnadminUserIdChanged();
}
}
}
private global::System.Int32 _adminUserId;
partial void OnadminUserIdChanging(global::System.Int32 value);
partial void OnadminUserIdChanged();
#endregion
}
當我使用這個類在我的作業合同
int adminRegister(tbl_adminUser _adminUser);
它給出了該方法的錯誤,「該操作在WCF Test Client中不受支持,因爲它使用tbl類型_adminUser」
感謝
我不想爲映射創建額外的類,我想在我的操作合約中使用tbl_adminUser,謝謝 – MZH