public ContentResult NewPMCount() { var user = this.CurrentUser(); if (user == null) { return(Content(String.Empty)); } var count = _privateMessageService.GetUnreadCount(user); return(Content(count.ToString())); }
public ContentResult NewPMCount() { var user = _userRetrievalShim.GetUser(HttpContext); if (user == null) { return(Content(String.Empty)); } var count = _privateMessageService.GetUnreadCount(user); return(Content(count.ToString())); }
public async Task <ContentResult> NewPMCount() { var user = _userRetrievalShim.GetUser(); if (user == null) { return(Content(String.Empty)); } var count = await _privateMessageService.GetUnreadCount(user); return(Content(count.ToString())); }
public IViewComponentResult Invoke() { var container = new UserNavigationContainer(); container.User = _userRetrievalShim.GetUser(HttpContext); if (container.User != null) { var count = _privateMessageService.GetUnreadCount(container.User); if (count > 0) { container.PMCount = String.Format("<span class=\"badge\">{0}</span>", count); } } return(View(container)); }
public async Task <IViewComponentResult> InvokeAsync() { var container = new UserNavigationContainer(); container.User = _userRetrievalShim.GetUser(); if (container.User != null) { var count = await _privateMessageService.GetUnreadCount(container.User); if (count > 0) { container.PMCount = $"<span class=\"badge\">{count}</span>"; } } return(View(container)); }