public async Task GetByIdIncludingUserAsync()
        {
            var user = await userEntityFramework.AddAsync(builder.CreateUserWithTasks(2));

            var tasks  = user.TasksToDo;
            var result = await taskToDoEntityFramework.GetByIdIncludingUserAsync(tasks.FirstOrDefault().Id);

            Assert.AreEqual(result.UserId, user.Id);
        }
コード例 #2
0
        public async Task GetByIdIncludingUserAsync()
        {
            var user = await userDapper.AddAsync(userBuilder.CreateUser());

            var task = await taskToDoDapper.AddAsync(taskToDoBuilder.CreateTaskToDoWithUser(user.Id));

            var result = await taskToDoDapper.GetByIdIncludingUserAsync(task.Id);

            Assert.AreEqual(result.UserId, user.Id);
        }
コード例 #3
0
        public async Task GetByIdIncludingUserAsync()
        {
            using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
            {
                var conn = databaseOptions.GetDbConnection;
                userDapper     = new UserRepository(conn);
                taskToDoDapper = new TaskToDoRepository(conn);

                var user = await userDapper.AddAsync(userBuilder.CreateUser());

                var task = await taskToDoDapper.AddAsync(taskToDoBuilder.CreateTaskToDoWithUser(user.Id));

                var result = await taskToDoDapper.GetByIdIncludingUserAsync(task.Id);

                Assert.AreEqual(result.UserId, user.Id);
            }
        }
コード例 #4
0
 public async Task <TaskToDo> GetByIdIncludingUserAsync(int id)
 {
     return(await _repository.GetByIdIncludingUserAsync(id));
 }