public override void OnActionExecuting(ActionExecutingContext context) { base.OnActionExecuting(context); ChatMenuView menu = _chatMenuItemsFabric.BuildChatMenu(); ViewData["Chats"] = menu; }
public ChatMenuView BuildChatMenu() { ChatMenuView result = new ChatMenuView(); GetAllRoomsChatView rooms = Task .Run(async() => await _chatService.GetAllRooms()) .Result; if (!rooms.Rooms.Any()) { return(result); } result = _mapper.Map(rooms, result); return(result); }