| | | 1 | | using System.Collections.Generic; |
| | | 2 | | |
| | | 3 | | namespace NexusLabs.Needlr.Generators.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// A fully resolved composed registration: one closed composition type, exposed as a facade service type, |
| | | 7 | | /// with its constructor dependencies resolved to service-provider expressions. Emitted as a single |
| | | 8 | | /// <c>services.Add{Lifetime}</c> registration. |
| | | 9 | | /// </summary> |
| | | 10 | | internal readonly struct DiscoveredComposedRegistration |
| | | 11 | | { |
| | | 12 | | public DiscoveredComposedRegistration( |
| | | 13 | | string facadeTypeName, |
| | | 14 | | string closedCompositionTypeName, |
| | | 15 | | IReadOnlyList<string> constructorArguments, |
| | | 16 | | GeneratorLifetime lifetime, |
| | | 17 | | string assemblyName, |
| | | 18 | | string? sourceFilePath) |
| | | 19 | | { |
| | 54 | 20 | | FacadeTypeName = facadeTypeName; |
| | 54 | 21 | | ClosedCompositionTypeName = closedCompositionTypeName; |
| | 54 | 22 | | ConstructorArguments = constructorArguments; |
| | 54 | 23 | | Lifetime = lifetime; |
| | 54 | 24 | | AssemblyName = assemblyName; |
| | 54 | 25 | | SourceFilePath = sourceFilePath; |
| | 54 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary>The fully qualified facade service type the closed composition is registered as.</summary> |
| | 108 | 29 | | public string FacadeTypeName { get; } |
| | | 30 | | |
| | | 31 | | /// <summary>The fully qualified closed composition type to instantiate (e.g., global::N.FooCore<global::N.AlphaD |
| | 108 | 32 | | public string ClosedCompositionTypeName { get; } |
| | | 33 | | |
| | | 34 | | /// <summary>The constructor argument expressions (e.g., sp.GetRequiredService<...>()), in declaration order.< |
| | 291 | 35 | | public IReadOnlyList<string> ConstructorArguments { get; } |
| | | 36 | | |
| | | 37 | | /// <summary>The lifetime this registration is given.</summary> |
| | 54 | 38 | | public GeneratorLifetime Lifetime { get; } |
| | | 39 | | |
| | | 40 | | /// <summary>The name of the assembly that declared the composition type.</summary> |
| | 0 | 41 | | public string AssemblyName { get; } |
| | | 42 | | |
| | | 43 | | /// <summary>The source file path of the composition type, if available.</summary> |
| | 108 | 44 | | public string? SourceFilePath { get; } |
| | | 45 | | } |