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); }
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); }
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); } }
public async Task <TaskToDo> GetByIdIncludingUserAsync(int id) { return(await _repository.GetByIdIncludingUserAsync(id)); }