这是我的控制器的一些示例代码:
public class ContentController : ApiController
{
private IContentService _contentService;
public ContentController(
IContentService contentService)
{
_contentService = contentService;
}
// GET api/Content/5
[HttpGet]
[ActionName("GetContent")]
public Content GetContent(int Id)
{
Content content = _uow.Contents.GetById(Id);
if (content == null)
{
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
}
return content;
}
我想找到用户的ID。有人能告诉我我该怎么做吗?我正在使用标准的 ASP.NET 简单身份验证,并且我使用了 ASP.NET MVC 帐户控制器来登录我的用户。