我正在研究 WCF 数据服务。我的服务中有一个函数,它将记录添加到 SQL DB 中的表中并返回插入记录的 ID。
我曾经以参数的形式将要插入的值传递给函数。
例如
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
}
我在我的服务中编写了上面的功能,我的服务项目成功了。当我更新我的 ServiceRefrences 时,我得到了Error。
它说只支持原始类型。有没有解决这个问题的方法。
感谢您花时间回答我的问题。