//public void GetAll() //{ // SendTask(); //} public void CompleteTask(int taskId) { repo.CompleteTask(taskId); var tasks = repo.GetTasks(); foreach (Task t in tasks) { if (t.UserId == null) { t.User = new User { FirstName = "", LastName = "" }; } } Clients.All.AppendTask(tasks.Select(t => new { Id = t.Id, Title = t.Title, Status = t.Status, UserId = t.UserId, FirstName = t.User.FirstName, LastName = t.User.LastName })); }