我似乎无法找到使用什么而不是这个,但这就是我以前所拥有的:
using ServiceStack.Common.Utils;
...
public Profile Put(ProfileUpdate req) {
var cred = this.GetCredential();
this.AskUser();
var data = Db.GetById<Profile>(cred.UserId);
ReflectionUtils.PopulateObject<Profile, ProfileUpdatable>(data, req);
现在我无法找到版本4.0.20中的Utils或ReflectionUtils或PopulateObject的位置
答案 0 :(得分:2)
这些功能已被这些auto mapping functions, documented here取代。
所以你会使用:
var data = Db.GetById<Profile>(cred.UserId);
data.PopulateWith(req);