Class KernelDescriptor
Describes a kernel registration with its input/output types and factory.
public sealed class KernelDescriptor
- Inheritance
-
KernelDescriptor
- Inherited Members
Properties
Factory
Gets or sets the factory function for creating kernel instances.
public Func<IServiceProvider, object>? Factory { get; set; }
Property Value
Id
Gets or sets the kernel identifier.
public KernelId Id { get; set; }
Property Value
InType
Gets or sets the input type for the kernel.
public Type InType { get; set; }
Property Value
OutType
Gets or sets the output type for the kernel.
public Type OutType { get; set; }
Property Value
Methods
Build(Action<KernelDescriptor>)
Builds a kernel descriptor using a configuration action.
public static KernelDescriptor Build(Action<KernelDescriptor> cfg)
Parameters
cfgAction<KernelDescriptor>Configuration action to apply to the descriptor.
Returns
- KernelDescriptor
A configured kernel descriptor.
FromFactory(Func<IServiceProvider, object>)
Sets the factory function for creating kernel instances.
public KernelDescriptor FromFactory(Func<IServiceProvider, object> f)
Parameters
fFunc<IServiceProvider, object>The factory function.
Returns
- KernelDescriptor
The descriptor for fluent chaining.
In<T>()
Sets the input type for the kernel.
public KernelDescriptor In<T>()
Returns
- KernelDescriptor
The descriptor for fluent chaining.
Type Parameters
TThe input type.
Out<T>()
Sets the output type for the kernel.
public KernelDescriptor Out<T>()
Returns
- KernelDescriptor
The descriptor for fluent chaining.
Type Parameters
TThe output type.
SetId(string)
Sets the kernel identifier.
public KernelDescriptor SetId(string id)
Parameters
idstringThe kernel identifier string.
Returns
- KernelDescriptor
The descriptor for fluent chaining.