diff --git a/readme/ArrayDetails.md b/readme/ArrayDetails.md index 1f5669dc0..400e14ff0 100644 --- a/readme/ArrayDetails.md +++ b/readme/ArrayDetails.md @@ -287,8 +287,9 @@ partial class Array { case null: return composition.TestPureDIByCR(); + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } } } diff --git a/readme/EnumDetails.md b/readme/EnumDetails.md index 750ce6856..d71a46c58 100644 --- a/readme/EnumDetails.md +++ b/readme/EnumDetails.md @@ -296,8 +296,9 @@ partial class Enum { case null: return composition.TestPureDIByCR(); + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } } } diff --git a/readme/FuncDetails.md b/readme/FuncDetails.md index e4d8d103a..455b4943a 100644 --- a/readme/FuncDetails.md +++ b/readme/FuncDetails.md @@ -252,8 +252,9 @@ partial class Func { case null: return composition.TestPureDIByCR(); + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } } } diff --git a/readme/SingletonDetails.md b/readme/SingletonDetails.md index 17a8fb09e..5ac70bdcf 100644 --- a/readme/SingletonDetails.md +++ b/readme/SingletonDetails.md @@ -259,8 +259,9 @@ partial class Singleton { case null: return composition.TestPureDIByCR(); + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } } } diff --git a/readme/TransientDetails.md b/readme/TransientDetails.md index c66387555..45d7821cb 100644 --- a/readme/TransientDetails.md +++ b/readme/TransientDetails.md @@ -249,8 +249,9 @@ partial class Transient { case null: return composition.TestPureDIByCR(); + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.Benchmarks.Model.CompositionRoot."); } } } diff --git a/readme/a-few-partial-classes.md b/readme/a-few-partial-classes.md index 21439b437..1d33cf881 100644 --- a/readme/a-few-partial-classes.md +++ b/readme/a-few-partial-classes.md @@ -231,8 +231,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.SeveralPartialClassesScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.SeveralPartialClassesScenario.IService."); } } } diff --git a/readme/accumulators.md b/readme/accumulators.md index fa41afe8c..19f84b18e 100644 --- a/readme/accumulators.md +++ b/readme/accumulators.md @@ -285,8 +285,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type (Pure.DI.UsageTests.Advanced.AccumulatorScenario.IService service, Pure.DI.UsageTests.Advanced.AccumulatorScenario.MyAccumulator accumulator)."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type (Pure.DI.UsageTests.Advanced.AccumulatorScenario.IService service, Pure.DI.UsageTests.Advanced.AccumulatorScenario.MyAccumulator accumulator)."); } object global::Pure.DI.IResolver.Resolve(Composition composition) { diff --git a/readme/advanced-interception.md b/readme/advanced-interception.md index ad0fc70f4..357c9072d 100644 --- a/readme/advanced-interception.md +++ b/readme/advanced-interception.md @@ -301,8 +301,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Interception.AdvancedInterceptionScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Interception.AdvancedInterceptionScenario.IService."); } } } diff --git a/readme/arguments.md b/readme/arguments.md index 12a2ae7ea..c65101c64 100644 --- a/readme/arguments.md +++ b/readme/arguments.md @@ -263,8 +263,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.ArgumentsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.ArgumentsScenario.IService."); } } } diff --git a/readme/array.md b/readme/array.md index c216997d9..dbf402f1e 100644 --- a/readme/array.md +++ b/readme/array.md @@ -266,8 +266,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ArrayScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ArrayScenario.IService."); } } } diff --git a/readme/async-enumerable.md b/readme/async-enumerable.md index 85f1a70eb..34b8702a4 100644 --- a/readme/async-enumerable.md +++ b/readme/async-enumerable.md @@ -256,8 +256,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.IService."); } } } diff --git a/readme/auto-scoped.md b/readme/auto-scoped.md index abc6cb8d1..388085d38 100644 --- a/readme/auto-scoped.md +++ b/readme/auto-scoped.md @@ -307,8 +307,9 @@ partial class Composition { case null: return composition.SessionRoot; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service."); } } @@ -325,8 +326,9 @@ partial class Composition { case null: return composition.ProgramRoot; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program."); } } } diff --git a/readme/check-for-a-root.md b/readme/check-for-a-root.md index 2076dbb21..da043fa81 100644 --- a/readme/check-for-a-root.md +++ b/readme/check-for-a-root.md @@ -273,8 +273,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.CheckForRootScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.CheckForRootScenario.IService."); } } @@ -291,8 +292,9 @@ partial class Composition { case "MyDep": return composition.RootM04D13di0001; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.CheckForRootScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.CheckForRootScenario.IDependency."); } } } diff --git a/readme/complex-generics.md b/readme/complex-generics.md index 1cce0860e..eec830945 100644 --- a/readme/complex-generics.md +++ b/readme/complex-generics.md @@ -274,8 +274,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Generics.ComplexGenericsScenario.Program."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Generics.ComplexGenericsScenario.Program."); } } } diff --git a/readme/composition-root-kinds.md b/readme/composition-root-kinds.md index d593efe40..acce24075 100644 --- a/readme/composition-root-kinds.md +++ b/readme/composition-root-kinds.md @@ -267,8 +267,9 @@ partial class Composition return composition.GetOtherService(); case null: return composition.GetRoot(); + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.CompositionRootKindsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.CompositionRootKindsScenario.IService."); } } @@ -285,8 +286,9 @@ partial class Composition { case null: return Composition.Dependency; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.CompositionRootKindsScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.CompositionRootKindsScenario.IDependency."); } } } diff --git a/readme/composition-roots-simplified.md b/readme/composition-roots-simplified.md index df26e8144..6f6e3c3ee 100644 --- a/readme/composition-roots-simplified.md +++ b/readme/composition-roots-simplified.md @@ -252,8 +252,9 @@ partial class Composition return composition.RootM04D13di0002; case null: return composition.MyRoot; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.CompositionRootsSimplifiedScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.CompositionRootsSimplifiedScenario.IService."); } } } diff --git a/readme/composition-roots.md b/readme/composition-roots.md index a59b315ea..4d3f7ac11 100644 --- a/readme/composition-roots.md +++ b/readme/composition-roots.md @@ -292,8 +292,9 @@ partial class Composition return composition.SomeOtherService; case null: return composition.MyRoot; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.CompositionRootsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.CompositionRootsScenario.IService."); } } @@ -310,8 +311,9 @@ partial class Composition { case null: return composition.RootM04D13di0003; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency."); } } } diff --git a/readme/constructor-ordinal-attribute.md b/readme/constructor-ordinal-attribute.md index 5dd8a250f..4653ff90a 100644 --- a/readme/constructor-ordinal-attribute.md +++ b/readme/constructor-ordinal-attribute.md @@ -228,8 +228,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.IService."); } } } diff --git a/readme/custom-attributes.md b/readme/custom-attributes.md index dd409e9cb..44dbc3f6f 100644 --- a/readme/custom-attributes.md +++ b/readme/custom-attributes.md @@ -245,8 +245,9 @@ partial class PersonComposition { case null: return composition.Person; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Attributes.CustomAttributesScenario.IPerson."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Attributes.CustomAttributesScenario.IPerson."); } } } diff --git a/readme/decorator.md b/readme/decorator.md index b102b3ef5..440040bed 100644 --- a/readme/decorator.md +++ b/readme/decorator.md @@ -213,8 +213,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Interception.DecoratorScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Interception.DecoratorScenario.IService."); } } } diff --git a/readme/default-lifetime.md b/readme/default-lifetime.md index 2deee0e08..9aa66d98f 100644 --- a/readme/default-lifetime.md +++ b/readme/default-lifetime.md @@ -251,8 +251,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.IService."); } } } diff --git a/readme/default-values.md b/readme/default-values.md index 0dcd15e17..bfdb2dacf 100644 --- a/readme/default-values.md +++ b/readme/default-values.md @@ -229,8 +229,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.DefaultValuesScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.DefaultValuesScenario.IService."); } } } diff --git a/readme/dependent-compositions.md b/readme/dependent-compositions.md index 866c27f91..11feb99bb 100644 --- a/readme/dependent-compositions.md +++ b/readme/dependent-compositions.md @@ -242,8 +242,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.DependentCompositionsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.DependentCompositionsScenario.IService."); } } } @@ -427,8 +428,9 @@ partial class OtherComposition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.DependentCompositionsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.DependentCompositionsScenario.IService."); } } @@ -445,8 +447,9 @@ partial class OtherComposition { case null: return composition.Program; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.DependentCompositionsScenario.Program."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.DependentCompositionsScenario.Program."); } } } diff --git a/readme/disposable-singleton.md b/readme/disposable-singleton.md index 66073463c..66d5075c1 100644 --- a/readme/disposable-singleton.md +++ b/readme/disposable-singleton.md @@ -278,8 +278,9 @@ partial class Composition: global::System.IDisposable { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.IService."); } } } diff --git a/readme/enumerable-generics.md b/readme/enumerable-generics.md index d81332227..b2a86aa22 100644 --- a/readme/enumerable-generics.md +++ b/readme/enumerable-generics.md @@ -320,8 +320,9 @@ partial class Composition { case null: return composition.IntRoot; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService."); } } @@ -338,8 +339,9 @@ partial class Composition { case null: return composition.StringRoot; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService."); } } } diff --git a/readme/enumerable.md b/readme/enumerable.md index 2cd4e7630..eb5abbc3f 100644 --- a/readme/enumerable.md +++ b/readme/enumerable.md @@ -248,8 +248,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.EnumerableScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.EnumerableScenario.IService."); } } } diff --git a/readme/factory.md b/readme/factory.md index 1119a2403..4dfb53d93 100644 --- a/readme/factory.md +++ b/readme/factory.md @@ -322,8 +322,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.FactoryScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.FactoryScenario.IService."); } } } diff --git a/readme/field-injection.md b/readme/field-injection.md index a5a08f180..72b53dc47 100644 --- a/readme/field-injection.md +++ b/readme/field-injection.md @@ -228,8 +228,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.FieldInjectionScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.FieldInjectionScenario.IService."); } } } diff --git a/readme/func-with-arguments.md b/readme/func-with-arguments.md index f8df267c1..59f8fe496 100644 --- a/readme/func-with-arguments.md +++ b/readme/func-with-arguments.md @@ -291,8 +291,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.IService."); } } } diff --git a/readme/func-with-tag.md b/readme/func-with-tag.md index eed3b9d27..d39c16796 100644 --- a/readme/func-with-tag.md +++ b/readme/func-with-tag.md @@ -239,8 +239,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.FuncWithTagScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.FuncWithTagScenario.IService."); } } } diff --git a/readme/func.md b/readme/func.md index 904ca8307..5d4f8fa4d 100644 --- a/readme/func.md +++ b/readme/func.md @@ -242,8 +242,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.FuncScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.FuncScenario.IService."); } } } diff --git a/readme/generics.md b/readme/generics.md index 366389226..0ef3dcde4 100644 --- a/readme/generics.md +++ b/readme/generics.md @@ -256,8 +256,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Generics.GenericsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Generics.GenericsScenario.IService."); } } } diff --git a/readme/injection.md b/readme/injection.md index 5d52aeb20..55ca350c3 100644 --- a/readme/injection.md +++ b/readme/injection.md @@ -228,8 +228,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.InjectionScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.InjectionScenario.IService."); } } } diff --git a/readme/instance-initialization.md b/readme/instance-initialization.md index 531ebfe10..1464d5f15 100644 --- a/readme/instance-initialization.md +++ b/readme/instance-initialization.md @@ -253,8 +253,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.InstanceInitializationScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.InstanceInitializationScenario.IService."); } } } diff --git a/readme/interception.md b/readme/interception.md index f2b0e33fb..d2e286707 100644 --- a/readme/interception.md +++ b/readme/interception.md @@ -229,8 +229,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Interception.InterceptionScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Interception.InterceptionScenario.IService."); } } } diff --git a/readme/keyed-service-provider.md b/readme/keyed-service-provider.md index 772c05eb1..987efd35e 100644 --- a/readme/keyed-service-provider.md +++ b/readme/keyed-service-provider.md @@ -276,8 +276,9 @@ partial class Composition { case "Dependency Key": return composition.RootM04D13di0001; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency."); } } @@ -294,8 +295,9 @@ partial class Composition { case "Service Key": return composition.RootM04D13di0002; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService."); } } } diff --git a/readme/lazy.md b/readme/lazy.md index 1aa66f5a3..4bca2a701 100644 --- a/readme/lazy.md +++ b/readme/lazy.md @@ -243,8 +243,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.LazyScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.LazyScenario.IService."); } } } diff --git a/readme/member-ordinal-attribute.md b/readme/member-ordinal-attribute.md index 5dcaf08c3..998a24a2b 100644 --- a/readme/member-ordinal-attribute.md +++ b/readme/member-ordinal-attribute.md @@ -271,8 +271,9 @@ partial class PersonComposition { case null: return composition.Person; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.IPerson."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.IPerson."); } } } diff --git a/readme/method-injection.md b/readme/method-injection.md index 2cd4729e5..f659b060a 100644 --- a/readme/method-injection.md +++ b/readme/method-injection.md @@ -229,8 +229,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.MethodInjectionScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.MethodInjectionScenario.IService."); } } } diff --git a/readme/multi-contract-bindings.md b/readme/multi-contract-bindings.md index 5d8738ca1..48ccdf4e9 100644 --- a/readme/multi-contract-bindings.md +++ b/readme/multi-contract-bindings.md @@ -231,8 +231,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.MultiContractBindingsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.MultiContractBindingsScenario.IService."); } } } diff --git a/readme/oncannotresolve-hint.md b/readme/oncannotresolve-hint.md index 93abc4e41..983292eb2 100644 --- a/readme/oncannotresolve-hint.md +++ b/readme/oncannotresolve-hint.md @@ -253,8 +253,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.IService."); } } } diff --git a/readme/ondependencyinjection-hint.md b/readme/ondependencyinjection-hint.md index 44053205a..e6bd481a0 100644 --- a/readme/ondependencyinjection-hint.md +++ b/readme/ondependencyinjection-hint.md @@ -247,8 +247,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.OnDependencyInjectionHintScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.OnDependencyInjectionHintScenario.IService."); } } } diff --git a/readme/onnewinstance-hint.md b/readme/onnewinstance-hint.md index 195fcb42e..5cfc656cc 100644 --- a/readme/onnewinstance-hint.md +++ b/readme/onnewinstance-hint.md @@ -270,8 +270,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.IService."); } } } diff --git a/readme/overriding-the-bcl-binding.md b/readme/overriding-the-bcl-binding.md index f4d6ebc1b..0205aee61 100644 --- a/readme/overriding-the-bcl-binding.md +++ b/readme/overriding-the-bcl-binding.md @@ -225,8 +225,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IService."); } } } diff --git a/readme/partial-class.md b/readme/partial-class.md index 70632898f..08fc6f297 100644 --- a/readme/partial-class.md +++ b/readme/partial-class.md @@ -260,8 +260,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.PartialClassScenario.Service."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.PartialClassScenario.Service."); } } } diff --git a/readme/perblock.md b/readme/perblock.md index fa14bfbad..2eb6ee614 100644 --- a/readme/perblock.md +++ b/readme/perblock.md @@ -262,8 +262,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service."); } } } diff --git a/readme/perresolve.md b/readme/perresolve.md index 26560c46f..122e4fb4f 100644 --- a/readme/perresolve.md +++ b/readme/perresolve.md @@ -281,8 +281,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service."); } } } diff --git a/readme/property-injection.md b/readme/property-injection.md index 05c5a810f..fe5eefb7f 100644 --- a/readme/property-injection.md +++ b/readme/property-injection.md @@ -226,8 +226,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.PropertyInjectionScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.PropertyInjectionScenario.IService."); } } } diff --git a/readme/required-properties-or-fields.md b/readme/required-properties-or-fields.md index e530bc14c..3274c1e1b 100644 --- a/readme/required-properties-or-fields.md +++ b/readme/required-properties-or-fields.md @@ -249,8 +249,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.IService."); } } } diff --git a/readme/resolve-methods.md b/readme/resolve-methods.md index 0aabdbb0c..325b26b9e 100644 --- a/readme/resolve-methods.md +++ b/readme/resolve-methods.md @@ -271,8 +271,9 @@ partial class Composition return composition.OtherService; case null: return composition.RootM04D13di0002; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.ResolveScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.ResolveScenario.IService."); } } @@ -289,8 +290,9 @@ partial class Composition { case null: return composition.RootM04D13di0001; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.ResolveScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.ResolveScenario.IDependency."); } } } diff --git a/readme/rootbind.md b/readme/rootbind.md index 8ee326545..130c5e905 100644 --- a/readme/rootbind.md +++ b/readme/rootbind.md @@ -190,8 +190,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.RootBindScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.RootBindScenario.IService."); } } } diff --git a/readme/scope.md b/readme/scope.md index e07e545dd..21758326f 100644 --- a/readme/scope.md +++ b/readme/scope.md @@ -359,8 +359,9 @@ partial class Composition: global::System.IDisposable { case null: return composition.SessionRoot; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.ScopeScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.ScopeScenario.IService."); } } @@ -377,8 +378,9 @@ partial class Composition: global::System.IDisposable { case null: return composition.ProgramRoot; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program."); } } } diff --git a/readme/service-collection.md b/readme/service-collection.md index f89acffbf..ab049d77e 100644 --- a/readme/service-collection.md +++ b/readme/service-collection.md @@ -275,8 +275,9 @@ partial class Composition { case "Dependency Key": return composition.RootM04D13di0001; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency."); } } @@ -293,8 +294,9 @@ partial class Composition { case null: return composition.RootM04D13di0002; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService."); } } } diff --git a/readme/service-provider-with-scope.md b/readme/service-provider-with-scope.md index 9b3989740..2eacf5fe2 100644 --- a/readme/service-provider-with-scope.md +++ b/readme/service-provider-with-scope.md @@ -338,8 +338,9 @@ partial class Composition: global::System.IDisposable { case null: return composition.RootM04D13di0001; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency."); } } @@ -356,8 +357,9 @@ partial class Composition: global::System.IDisposable { case null: return composition.RootM04D13di0002; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService."); } } } diff --git a/readme/service-provider.md b/readme/service-provider.md index f93d5f332..7f6c3bf01 100644 --- a/readme/service-provider.md +++ b/readme/service-provider.md @@ -271,8 +271,9 @@ partial class Composition { case null: return composition.RootM04D13di0001; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency."); } } @@ -289,8 +290,9 @@ partial class Composition { case null: return composition.RootM04D13di0002; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService."); } } } diff --git a/readme/singleton.md b/readme/singleton.md index 720178f68..da94cac59 100644 --- a/readme/singleton.md +++ b/readme/singleton.md @@ -244,8 +244,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.SingletonScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.SingletonScenario.IService."); } } } diff --git a/readme/span-and-readonlyspan.md b/readme/span-and-readonlyspan.md index de3a0ce13..1e77278f2 100644 --- a/readme/span-and-readonlyspan.md +++ b/readme/span-and-readonlyspan.md @@ -239,8 +239,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.SpanScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.SpanScenario.IService."); } } } diff --git a/readme/tag-attribute.md b/readme/tag-attribute.md index 42d41739d..c060e45c5 100644 --- a/readme/tag-attribute.md +++ b/readme/tag-attribute.md @@ -246,8 +246,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.TagAttributeScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.TagAttributeScenario.IService."); } } } diff --git a/readme/tag-type.md b/readme/tag-type.md index 601144a68..00588156a 100644 --- a/readme/tag-type.md +++ b/readme/tag-type.md @@ -299,8 +299,9 @@ partial class Composition if (Equals(tag, typeof(Pure.DI.UsageTests.Advanced.TagTypeScenario.XyzDependency))) return composition.XyzRoot; switch (tag) { + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.TagTypeScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.TagTypeScenario.IDependency."); } } @@ -317,8 +318,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.TagTypeScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.TagTypeScenario.IService."); } } } diff --git a/readme/tag-unique.md b/readme/tag-unique.md index 7e907d008..6d2144815 100644 --- a/readme/tag-unique.md +++ b/readme/tag-unique.md @@ -246,8 +246,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.TagUniqueScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Advanced.TagUniqueScenario.IService."); } } } diff --git a/readme/tags.md b/readme/tags.md index 9ab582a97..1453b6465 100644 --- a/readme/tags.md +++ b/readme/tags.md @@ -304,8 +304,9 @@ partial class Composition { case "Xyz": return composition.XyzRoot; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.TagsScenario.IDependency."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.TagsScenario.IDependency."); } } @@ -322,8 +323,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.TagsScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.TagsScenario.IService."); } } } diff --git a/readme/threadsafe-hint.md b/readme/threadsafe-hint.md index d07d65aff..5fe3851c5 100644 --- a/readme/threadsafe-hint.md +++ b/readme/threadsafe-hint.md @@ -217,8 +217,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.ThreadSafeHintScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.ThreadSafeHintScenario.IService."); } } } diff --git a/readme/tostring-hint.md b/readme/tostring-hint.md index a223b547e..f6ffb453d 100644 --- a/readme/tostring-hint.md +++ b/readme/tostring-hint.md @@ -215,8 +215,9 @@ partial class Composition { case null: return composition.MyService; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.ToStringHintScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Hints.ToStringHintScenario.IService."); } } } diff --git a/readme/tracking-disposable-instances-in-delegates.md b/readme/tracking-disposable-instances-in-delegates.md index 823e77e6a..28fca5057 100644 --- a/readme/tracking-disposable-instances-in-delegates.md +++ b/readme/tracking-disposable-instances-in-delegates.md @@ -291,8 +291,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.TrackingDisposableInDelegatesScenario.Service."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.TrackingDisposableInDelegatesScenario.Service."); } } } diff --git a/readme/transient.md b/readme/transient.md index dc1c58bc2..dea11253e 100644 --- a/readme/transient.md +++ b/readme/transient.md @@ -229,8 +229,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.TransientScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Lifetimes.TransientScenario.IService."); } } } diff --git a/readme/tuple.md b/readme/tuple.md index 1f6343132..8fc0c34c3 100644 --- a/readme/tuple.md +++ b/readme/tuple.md @@ -236,8 +236,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.TupleScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.TupleScenario.IService."); } } } diff --git a/readme/type-attribute.md b/readme/type-attribute.md index 58855ba9c..c19982bf0 100644 --- a/readme/type-attribute.md +++ b/readme/type-attribute.md @@ -232,8 +232,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Attributes.TypeAttributeScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Attributes.TypeAttributeScenario.IService."); } } } diff --git a/readme/valuetask.md b/readme/valuetask.md index 2a5385fc9..886e774fa 100644 --- a/readme/valuetask.md +++ b/readme/valuetask.md @@ -238,8 +238,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ValueTaskScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ValueTaskScenario.IService."); } } } diff --git a/readme/weak-reference.md b/readme/weak-reference.md index 383e31a5c..91a62a57c 100644 --- a/readme/weak-reference.md +++ b/readme/weak-reference.md @@ -226,8 +226,9 @@ partial class Composition { case null: return composition.Root; + default: + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.WeakReferenceScenario.IService."); } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.WeakReferenceScenario.IService."); } } } diff --git a/src/Pure.DI.Core/Core/Code/ResolverClassesBuilder.cs b/src/Pure.DI.Core/Core/Code/ResolverClassesBuilder.cs index e533378ad..cd746028e 100644 --- a/src/Pure.DI.Core/Core/Code/ResolverClassesBuilder.cs +++ b/src/Pure.DI.Core/Core/Code/ResolverClassesBuilder.cs @@ -143,10 +143,15 @@ private static void ImplementInterface(CompositionCode composition, ResolverInfo code.AppendLine($"return {GetRoot(composition, taggedRoot)};"); } } + + code.AppendLine("default:"); + using (code.Indent()) + { + code.AppendLine($"throw new {Names.SystemNamespace}InvalidOperationException($\"{Names.CannotResolve} \\\"{{tag}}\\\" of type {resolver.Type}.\");"); + } } code.AppendLine("}"); - code.AppendLine($"throw new {Names.SystemNamespace}InvalidOperationException($\"{Names.CannotResolve} \\\"{{tag}}\\\" of type {resolver.Type}.\");"); } code.AppendLine("}");