diff --git a/Directory.Build.props b/Directory.Build.props index 18284154..a22c09c4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 2.1.29 + 2.1.30 Pure.DI latest net8.0 diff --git a/src/Pure.DI.Core/Components/Api.g.cs b/src/Pure.DI.Core/Components/Api.g.cs index 796463f0..afbacea7 100644 --- a/src/Pure.DI.Core/Components/Api.g.cs +++ b/src/Pure.DI.Core/Components/Api.g.cs @@ -1,5 +1,5 @@ // -#if !PUREDI_API_SUPPRESSION || PUREDI_API_V2 +#if !PUREDI_API_SUPPRESSION || PUREDI_API_V1 #pragma warning disable #if !NET40_OR_GREATER && !NETSTANDARD2_0_OR_GREATER && !NETCOREAPP2_0_OR_GREATER && !NET5_0_OR_GREATER diff --git a/src/Pure.DI.Core/Components/GenericTypeArguments.g.cs b/src/Pure.DI.Core/Components/GenericTypeArguments.g.cs index 62ddcf5b..5707dffb 100644 --- a/src/Pure.DI.Core/Components/GenericTypeArguments.g.cs +++ b/src/Pure.DI.Core/Components/GenericTypeArguments.g.cs @@ -1,5 +1,5 @@ // -#if !PUREDI_API_SUPPRESSION || PUREDI_API_V2 +#if !PUREDI_API_SUPPRESSION || PUREDI_API_V1 #pragma warning disable namespace Pure.DI { diff --git a/src/Pure.DI.Core/Features/Default.g.cs b/src/Pure.DI.Core/Features/Default.g.cs index 6626af57..0c28e68e 100644 --- a/src/Pure.DI.Core/Features/Default.g.cs +++ b/src/Pure.DI.Core/Features/Default.g.cs @@ -24,11 +24,7 @@ private static void Setup() Lifetime.PerResolve, Lifetime.PerBlock) #endif - .Bind().To(ctx => - { - ctx.Inject(out var owned); - return owned; - }) + .Bind().To((Owned owned) => owned) .Bind>() .As(Lifetime.PerBlock) .To(ctx => { @@ -64,23 +60,11 @@ private static void Setup() .Bind() .To(_ => global::System.Threading.Tasks.TaskContinuationOptions.None) .Bind().As(Lifetime.PerBlock) - .To(ctx => - { - ctx.Inject(out global::System.Threading.CancellationToken cancellationToken); - ctx.Inject(out global::System.Threading.Tasks.TaskCreationOptions taskCreationOptions); - ctx.Inject(out global::System.Threading.Tasks.TaskContinuationOptions taskContinuationOptions); - ctx.Inject(out global::System.Threading.Tasks.TaskScheduler taskScheduler); - return new global::System.Threading.Tasks.TaskFactory(cancellationToken, taskCreationOptions, taskContinuationOptions, taskScheduler); - }) + .To((global::System.Threading.CancellationToken cancellationToken, global::System.Threading.Tasks.TaskCreationOptions taskCreationOptions, global::System.Threading.Tasks.TaskContinuationOptions taskContinuationOptions, global::System.Threading.Tasks.TaskScheduler taskScheduler) => + new global::System.Threading.Tasks.TaskFactory(cancellationToken, taskCreationOptions, taskContinuationOptions, taskScheduler)) .Bind>().As(Lifetime.PerBlock) - .To(ctx => - { - ctx.Inject(out global::System.Threading.CancellationToken cancellationToken); - ctx.Inject(out global::System.Threading.Tasks.TaskCreationOptions taskCreationOptions); - ctx.Inject(out global::System.Threading.Tasks.TaskContinuationOptions taskContinuationOptions); - ctx.Inject(out global::System.Threading.Tasks.TaskScheduler taskScheduler); - return new global::System.Threading.Tasks.TaskFactory(cancellationToken, taskCreationOptions, taskContinuationOptions, taskScheduler); - }) + .To((global::System.Threading.CancellationToken cancellationToken, global::System.Threading.Tasks.TaskCreationOptions taskCreationOptions, global::System.Threading.Tasks.TaskContinuationOptions taskContinuationOptions, global::System.Threading.Tasks.TaskScheduler taskScheduler) => + new global::System.Threading.Tasks.TaskFactory(cancellationToken, taskCreationOptions, taskContinuationOptions, taskScheduler)) .Bind>() .To(ctx => { @@ -109,17 +93,9 @@ private static void Setup() // Collections #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.Memory(arr); - }) + .To((TT[] arr) => new global::System.Memory(arr)) .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.ReadOnlyMemory(arr); - }) + .To((TT[] arr) => new global::System.ReadOnlyMemory(arr)) .Bind>() .To(_ => global::System.Buffers.MemoryPool.Shared) .Bind>() @@ -128,161 +104,74 @@ private static void Setup() .Bind>() .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.Collections.Generic.List(arr); - }) + .To((TT[] arr) => new global::System.Collections.Generic.List(arr)) #if NETSTANDARD || NET || NETCOREAPP || NET45_OR_GREATER .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return arr; - }) + .To((TT[] arr) => arr) #endif #if NETSTANDARD1_1_OR_GREATER || NET || NETCOREAPP || NET40_OR_GREATER .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.Collections.Concurrent.ConcurrentBag(arr); - }) + .To((TT[] arr) => new global::System.Collections.Concurrent.ConcurrentBag(arr)) .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.Collections.Concurrent.ConcurrentQueue(arr); - }) + .To((TT[] arr) => new global::System.Collections.Concurrent.ConcurrentQueue(arr)) .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.Collections.Concurrent.ConcurrentStack(arr); - }) + .To((TT[] arr) => new global::System.Collections.Concurrent.ConcurrentStack(arr)) .Bind>() - .To(ctx => - { - ctx.Inject>(out var concurrentBag); - return new global::System.Collections.Concurrent.BlockingCollection(concurrentBag); - }) + .To((global::System.Collections.Concurrent.ConcurrentBag concurrentBag) => + new global::System.Collections.Concurrent.BlockingCollection(concurrentBag)) #endif #if NETSTANDARD || NET || NETCOREAPP || NET40_OR_GREATER .Bind>() #endif #if NETSTANDARD || NET || NETCOREAPP || NET35_OR_GREATER .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.Collections.Generic.HashSet(arr); - }) + .To((TT[] arr) =>new global::System.Collections.Generic.HashSet(arr)) #endif #if NETSTANDARD || NET || NETCOREAPP || NET45_OR_GREATER .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.Collections.Generic.SortedSet(arr); - }) + .To((TT[] arr) => new global::System.Collections.Generic.SortedSet(arr)) #endif .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.Collections.Generic.Queue(arr); - }) + .To((TT[] arr) => new global::System.Collections.Generic.Queue(arr)) .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return new global::System.Collections.Generic.Stack(arr); - }) + .To((TT[] arr) => new global::System.Collections.Generic.Stack(arr)) #if NETCOREAPP || NET #if NETCOREAPP3_0_OR_GREATER .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Runtime.CompilerServices.Unsafe.As>(ref arr); - }) + .To((TT[] arr) => global::System.Runtime.CompilerServices.Unsafe.As>(ref arr)) .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Runtime.CompilerServices.Unsafe.As>(ref arr); - }) + .To((TT[] arr) => global::System.Runtime.CompilerServices.Unsafe.As>(ref arr)) .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Runtime.CompilerServices.Unsafe.As>(ref arr); - }) + .To((TT[] arr) => global::System.Runtime.CompilerServices.Unsafe.As>(ref arr)) .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Runtime.CompilerServices.Unsafe.As>(ref arr); - }) + .To((TT[] arr) => global::System.Runtime.CompilerServices.Unsafe.As>(ref arr)) .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Runtime.CompilerServices.Unsafe.As>(ref arr); - }) + .To((TT[] arr) => global::System.Runtime.CompilerServices.Unsafe.As>(ref arr)) .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Runtime.CompilerServices.Unsafe.As>(ref arr); - }) + .To((TT[] arr) => global::System.Runtime.CompilerServices.Unsafe.As>(ref arr)) #else .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Collections.Immutable.ImmutableArray.Create(arr); - }) + .To((TT[] arr) => global::System.Collections.Immutable.ImmutableArray.Create(arr)) .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Collections.Immutable.ImmutableList.Create(arr); - }) + .To((TT[] arr) => global::System.Collections.Immutable.ImmutableList.Create(arr)) .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Collections.Immutable.ImmutableHashSet.Create(arr); - }) + .To((TT[] arr) => global::System.Collections.Immutable.ImmutableHashSet.Create(arr)) .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Collections.Immutable.ImmutableSortedSet.Create(arr); - }) + .To((TT[] arr) => global::System.Collections.Immutable.ImmutableSortedSet.Create(arr)) .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Collections.Immutable.ImmutableQueue.Create(arr); - }) + .To((TT[] arr) => global::System.Collections.Immutable.ImmutableQueue.Create(arr)) .Bind>() .Bind>() - .To(ctx => - { - ctx.Inject(out var arr); - return global::System.Collections.Immutable.ImmutableStack.Create(arr); - }) + .To((TT[] arr) => global::System.Collections.Immutable.ImmutableStack.Create(arr)) #endif #endif #if NET6_0_OR_GREATER @@ -291,16 +180,8 @@ private static void Setup() #if NETCOREAPP2_0 || NET || NETSTANDARD2_0_OR_GREATER .Bind().To(_ => global::System.Text.Encoding.Default) #endif - .Bind().To(ctx => - { - ctx.Inject(out global::System.Text.Encoding encoding); - return encoding.GetDecoder(); - }) - .Bind().To(ctx => - { - ctx.Inject(out global::System.Text.Encoding encoding); - return encoding.GetEncoder(); - }) + .Bind().To((global::System.Text.Encoding encoding) => encoding.GetDecoder()) + .Bind().To((global::System.Text.Encoding encoding) => encoding.GetEncoder()) ; } } diff --git a/src/Pure.DI.Core/Pure.DI.Core.csproj b/src/Pure.DI.Core/Pure.DI.Core.csproj index 55411c56..a91997c4 100644 --- a/src/Pure.DI.Core/Pure.DI.Core.csproj +++ b/src/Pure.DI.Core/Pure.DI.Core.csproj @@ -3,7 +3,7 @@ netstandard2.0 $(BasePackageId) - $(DefineConstants);PUREDI_API_SUPPRESSION;PUREDI_API_V2 + $(DefineConstants);PUREDI_API_SUPPRESSION;PUREDI_API_V1