I have a requirement like on my layout header I have to show the LocationName, UserRole and UserName apart from that we have some common properties which will gonna use internally to perform some logics based on the request.
To accomplish this I have created one baseModel
public class BaseModel
{
public string UserName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string RoleName { get; set; }
public string RoleId { get; set; }
public int UserId { get; set; }
public Dictionary<int,string> Orders { get; set; }
public Dictionary<int,string> CustomersBirthday { get; set; }
public int BranchId { get; set; }
public SelectList Branch { get; set; }
}
Scenario 1:
I wanted to fill this BaseModel with values at the time of successfull login, So that In each request the values should persist and I can use the same values.
Scenario 2: Whenever we do have any hit from client side for any controller at that time the values for BasedModel should not washed away.
The fact is I don't want to use the TempData and ViewBag. Therefore I am Looking for some alternative solution like this "BaseModel" class.
Any suggestion would be highly appreciable!!!