Interface IEngineRegistry
- Namespace
- Virtufin.WorkManager.Contracts
- Assembly
- Virtufin.WorkManager.dll
Provides mechanisms for registering and retrieving engine instances based on content type.
public interface IEngineRegistry
Methods
GetEngine(ContentType)
Gets an engine instance for the given content type.
IEngine? GetEngine(ContentType contentType)
Parameters
contentTypeContentTypeThe content type to get an engine for.
Returns
- IEngine
A new engine instance, or
nullif no engine is registered.
ListEngines()
Lists all registered engines.
IReadOnlyList<EngineInfo> ListEngines()
Returns
- IReadOnlyList<EngineInfo>
A read-only list of engine information.
Register(ContentType, string, Func<IEngine>)
Registers an engine factory for a given content type and language.
void Register(ContentType contentType, string languageName, Func<IEngine> engineFactory)
Parameters
contentTypeContentTypeThe content type handled by the engine.
languageNamestringThe name of the programming language.
engineFactoryFunc<IEngine>A factory function that creates new engine instances.
Exceptions
- InvalidOperationException
Thrown if an engine is already registered for the content type.
Unregister(ContentType)
Unregisters the engine for a given content type.
bool Unregister(ContentType contentType)
Parameters
contentTypeContentTypeThe content type to unregister.
Returns
- bool
trueif an engine was unregistered; otherwise,false.