1
我想比较一个AspnetUser ID与注册用户ID。我使用此代码:MVC AspNetUsers比较ID的
try
{
var userID = HttpContext.Current.User.Identity.GetUserId();
var communityId = (from p in context.UserCommunityRole
where p.AspNetUsers= userID
select p.CommunityID).FirstOrDefault();
return communityId;
}
但我收到follwoing错误,不明白为什么:
Cannot implicitly converttype 'string'(userID) to Models.AspNetUsers
任何一个可以帮我这个问题。
是你在哪里赖特。工作很好。谢谢 –