# registerClass method

1. @override

Future<void> registerClass({

1. List<Class<Object>>? classes,
2. Class<Object>? mainClass,

})
override

# Behavior

- Registers the provided classes with the application context.
- If `mainClass` is provided, it can serve as the primary configuration entry point (e.g., for bootstrapping or scanning dependent classes).
- Returns a Future that completes when registration is finished.

# Parameters

- `classes`: Optional list of classes to register. If omitted, the method may rely on previously scanned classes or `mainClass`.
- `mainClass`: Optional single class to register, often used as the main configuration class for the context.

# Example

    await context.register(
      classes: [MyService, MyRepository],
      mainClass: ApplicationMain,
    );

# Notes

- Registration is typically idempotent; calling multiple times should not create duplicate instances.
- Implementations may throw exceptions if class conflicts or invalid annotations are detected.

## Implementation

    @override
    Future<void> registerClass({List<Class<Object>>? classes, Class<Object>? mainClass}) async {
      if(classes != null) {
        await _reader.register(classes);
      }

      if(mainClass != null) {
        await _reader.doRegister(mainClass);
      }

      return Future.value();
    }