开发者

what is meaning of (model!=null) and (db!=null) in this context

public bool SetupEmpty(UserViewModel model, SimsContext db)
{
    if (model != null && db != nu开发者_如何学JAVAll)
    {
        // Setup the User
        model.User = new T2.Models.User();
        model.User.Roles = "";
        model.User.ActiveUser = true;

    }
    return false;
}


Checking that both model and db have been set before starting to use them. Otherwise, if one of them is not set the program could crash.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜