public async Task RegisterHandlerAsync(DeviceMethod method, Func <TRequest?, Task <TResponse> > methodAccessor, CancellationToken cancellationToken = default) { this.internalMethodAccessor = methodAccessor ?? throw new ArgumentNullException(nameof(methodAccessor)); await this.deviceClientAdapter.OpenAsync(cancellationToken); await this.deviceClientAdapter.DeviceClient.SetMethodHandlerAsync(method.GetMethodNameFor(), this.DeviceMethodHandler, new object(), cancellationToken); }