quickwire icon indicating copy to clipboard operation
quickwire copied to clipboard

[Suggest] How about inherited

Open tqk2811 opened this issue 10 months ago • 0 comments

[RegisterService(ServiceLifetime.Scoped)]
[InjectAllInitOnlyProperties]
public abstract class BaseScope
{
        public IScopeDataStore ScopeDataStore { get; init; }
}
public abstract class BaseScope2 : BaseScope
{
        public IScopeDataStore2 ScopeDataStore2 { get; init; }
}

public class Implement1 : BaseScope
{

}
public class Implement2 : BaseScope2 
{

}

[ServiceIgnore]
public class ImplementIgnore : BaseScope2 
{

}

I want it scan and auto add scope all childs Implement1, .......ImplementN ....(except abstract class or ignore attribute)
We can add some flag to attribute like [RegisterService(ServiceLifetime.Scoped, Inherited : true)] or new attribute [RegisterChildService(ServiceLifetime.Scoped)]

tqk2811 avatar Mar 12 '25 12:03 tqk2811