using Jab; namespace ConsoleApp; public interface ITypeA { } public interface ITypeB { } public class MyClass : ITypeA, ITypeB { } [ServiceProviderModule] [Scoped(typeof(ITypeA), Factory = nameof(TypeAFactory))] [Scoped(typeof(ITypeB), Factory = nameof(TypeBFactory))] [Scoped(typeof(MyClass))] public interface IModuleA : IServiceProvider { ITypeA TypeAFactory() => (ITypeA) GetService(typeof(MyClass)); ITypeB TypeBFactory() => (ITypeB) GetService(typeof(MyClass)); } [ServiceProvider] [Import(typeof(IModuleA))] public partial class Container { } internal class Program { private static void Main(string[] args) { var container = new Container(); var tA = container.GetService(); var tB = container.GetService(); var c = container.GetService(); } }