public bool AddTask(UserTask userTask) { if (userTask != null) { var result = _userTaskRepository.AddTask(userTask); return(result); } else { return(false); } }
public void SendTask(string task) { var ta = new Task(); ta.Title = task; repo.AddTask(ta); 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 })); }
public void AddUserTask(UserTask task) { var repo = new UserTaskRepository(_connectionString); repo.AddTask(task); }