public Task MarkMessageRead(Guid id) { return(taskQueue.QueueTask(() => { var message = dbContext.Messages.FindAsync(id).Result; if (message?.IsUnread != true) { return; } message.IsUnread = false; dbContext.SaveChanges(); notificationsHub.OnMessagesChanged().Wait(); }, true)); }