| | | 1 | | using Microsoft.Extensions.DependencyInjection; |
| | | 2 | | |
| | | 3 | | namespace NexusLabs.Needlr; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Options for customizing the output of <see cref="DumpExtensions.Dump(IServiceCollection, DumpOptions?)"/>. |
| | | 7 | | /// </summary> |
| | | 8 | | public sealed record DumpOptions |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Gets or sets an optional filter to only include services with a specific lifetime. |
| | | 12 | | /// When null, all lifetimes are included. |
| | | 13 | | /// </summary> |
| | 10 | 14 | | public ServiceLifetime? LifetimeFilter { get; init; } |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// Gets or sets an optional predicate to filter services by their service type. |
| | | 18 | | /// When null, all service types are included. |
| | | 19 | | /// </summary> |
| | 10 | 20 | | public Func<Type, bool>? ServiceTypeFilter { get; init; } |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Gets or sets whether to group registrations by lifetime in the output. |
| | | 24 | | /// Default is false. |
| | | 25 | | /// </summary> |
| | 7 | 26 | | public bool GroupByLifetime { get; init; } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Gets the default dump options with no filtering. |
| | | 30 | | /// </summary> |
| | 4 | 31 | | public static DumpOptions Default => new(); |
| | | 32 | | } |