我正在使用WCF数据服务。我在我的服务中有一个函数,它在SQL DB的表中添加一条记录并返回插入记录的ID。WCF数据服务ODATA
I用于将要插入参数形式的值传递给函数。
对于实例
public int Add(string Name, string Password)
{
// Here I will Add the record and return the ID of the record added in DB
}
,但我不想做传递参数的形式的这种方式。
我想直接传递对象。
像
public int Add(User user)
{
// Here I will Add the record and return the ID of the record added in DB
}
我在写服务功能类似上面,我的服务项目是全成。当我更新我的服务提示时,我收到错误。
它说只支持原始类型。有没有什么解决 这个问题。
感谢您的时间回答我的问题。
谢谢阿南德将开始这样做。其实我不熟悉使用堆栈溢出。谢谢你的建议。我会从现在开始做这件事.. – ssmsnet 2012-07-31 11:32:26
没问题。不用谢 ! – Anand 2012-07-31 11:33:33