bind<T> method

  1. @override
Future<T> bind<T>(
  1. EngineContext context,
  2. T instance
)
override

Binds the request body to the given instance.

This method decodes the request body and binds it to the provided instance.

context is the EngineContext of the request. instance is the object to bind the decoded body to.

Returns a Future that completes when binding is done.

Implementation

@override
Future<T> bind<T>(EngineContext context, T instance) async {
  final decoded = await _decodedBody(context); // Decode the request body.
  await bindBody(decoded, instance); // Bind the decoded body to the instance.
  return instance;
}