示例#1
0
        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);
        }
示例#2
0
 public UnitOfWork()
 {
     taskListRepository = new TaskListRepository(db);
     taskRepository     = new TaskRepository(db);
     userRepository     = new UserRepository(db);
 }