【发布时间】:2011-09-24 18:36:29
【问题描述】:
我正在创建一个基于 SOA 的应用程序,我使用 Framework 4.0 创建了 WCF 服务项目,因为我使用的是实体框架,在 WCF 操作合同方法中我使用的是由 EF 生成的类,但是WCF 无法识别这些对象,当我在设计器模式下检查这些类时,它们就像
[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 测试客户端不支持该操作,因为它使用类型 tbl_adminUser”
谢谢
【问题讨论】:
-
我不想为映射创建额外的类,我想在我的操作合同中使用 tbl_adminUser 谢谢
标签: wcf entity-framework