public IActionResult Notifications([FromQuery] int skip, [FromQuery] int take) { return(withUser(Request, user => { var result = _notificationProviderService.GetUserNotifications(user.Id, skip, take); return new JsonResult(result); })); }
public override async Task OnConnectedAsync() { var user = (UserDto)this.Context.GetHttpContext().Items["user"]; _manager.RegisterConnection(user.Id, Context.ConnectionId); var notifications = _notificationProviderService .GetUserNotifications(user.Id, 0, 20) .ToArray(); await base.OnConnectedAsync(); await SendInitialNotifications(notifications); }