I am maintaining an application and have seen something like this
Permission p = new UserModel().GetPermission(userToTestPerrmission, permissionWeCheck); if(p.CanChange) //sometihing else //something else
This approach looks a little "dirty" to me. The part I have problems with is this
new UserModel().GetPermission(). Is this a typical way to write something like this or should it be like:
var model = new UserModel(); model.GetPermissions(...); ...