public async Task AttachWallToUser(UserWallDTO userWallDTO) { var user = await unitOfWork.Users.GetByEmailAsync(userWallDTO.Email); var wall = await unitOfWork.Walls.GetAsync(userWallDTO.WallId); wall.UserId = user.Id; await unitOfWork.CompleteAsync(); }
public async Task <IActionResult> AttachWallToUser([FromBody] UserWallDTO userWallDTO) { try { await sensorService.AttachWallToUser(userWallDTO); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }