ServiceStack.Common.Utils.ReflectionUtils从3.9.69到4.0.20的位置

时间:2014-05-15 12:16:16

标签: servicestack

我似乎无法找到使用什么而不是这个,但这就是我以前所拥有的:

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的位置

1 个答案:

答案 0 :(得分:2)

这些功能已被这些auto mapping functions, documented here取代。

所以你会使用:

var data = Db.GetById<Profile>(cred.UserId);
data.PopulateWith(req);