bind method
Future<void>
bind(
- EngineContext context,
- dynamic instance, {
- Map<
String, String> ? rules,
override
Binds data from the request context to the given instance.
context - The context of the engine containing request data.
instance - The instance to which the data should be bound.
Implementation
@override
Future<void> bind(
EngineContext context,
dynamic instance, {
Map<String, String>? rules,
}) async {
final multipartForm = await context.multipartForm;
final data = multipartForm.fields;
if (instance is Map) {
for (final entry in data.entries) {
if (entry.value is MultipartFile) continue;
instance[entry.key] = entry.value;
}
}
}