public static VMERPUser Me
{
get
{
FormsIdentity userIdentity = HttpContext.Current.User.Identity as FormsIdentity;
if (userIdentity != null)
{
FormsAuthenticationTicket ticket = userIdentity.Ticket;
return JsonConvert.DeserializeObject<VMERPUser>(ticket.UserData);
}
return null;
}
}
讓我能夠通過這個方法得到值。不會報錯。求moq給httpcontext賦值的例子
解決了jijijijijijijijijijiji