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.
精彩评论