private static IList <Task> Read(SqlDataReader reader) { IList <Task> tasks = new List <Task>(); while (reader.Read()) { Task task = new Task(); task.Id = reader.GetInt32(0); task.Text = reader.GetString(1); task.Created = reader.GetDateTime(2); task.Done = reader.GetBoolean(3); task.UserId = reader.GetInt32(4); task.TaskListId = reader.GetInt32(5); task.Owner = UserRepository.Get2(task.UserId); task.Project = TaskListRepository.Get2(task.TaskListId); tasks.Add(task); } return(tasks); }
public UnitOfWork() { taskListRepository = new TaskListRepository(db); taskRepository = new TaskRepository(db); userRepository = new UserRepository(db); }