diff --git a/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/User/DomainModelUpdatedEventHandler.cs b/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/User/DomainModelUpdatedEventHandler.cs index 0a3db069..f6a19540 100644 --- a/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/User/DomainModelUpdatedEventHandler.cs +++ b/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/User/DomainModelUpdatedEventHandler.cs @@ -2,7 +2,6 @@ // Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. // ================================================================================================================================= -using Microsoft.AspNetCore.Identity; using RapidField.SolidInstruments.Command; using RapidField.SolidInstruments.Core.ArgumentValidation; using RapidField.SolidInstruments.Core.Concurrency; @@ -71,7 +70,7 @@ protected override void Process(DomainModel model, IEnumerable labels, G if (identityUser is null) { - identityUser = new IdentityUser() + identityUser = new() { AccessFailedCount = 0, Email = model.EmailAddress, diff --git a/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/UserRole/DomainModelUpdatedEventHandler.cs b/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/UserRole/DomainModelUpdatedEventHandler.cs index 3d0dbc27..9398e3ec 100644 --- a/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/UserRole/DomainModelUpdatedEventHandler.cs +++ b/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/UserRole/DomainModelUpdatedEventHandler.cs @@ -2,7 +2,6 @@ // Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. // ================================================================================================================================= -using Microsoft.AspNetCore.Identity; using RapidField.SolidInstruments.Command; using RapidField.SolidInstruments.Core.ArgumentValidation; using RapidField.SolidInstruments.Core.Concurrency; @@ -71,7 +70,7 @@ protected override void Process(DomainModel model, IEnumerable labels, G if (identityRole is null) { - identityRole = new IdentityRole() + identityRole = new() { Id = model.Identifier.ToString(), Name = model.Name diff --git a/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/UserRoleAssignment/DomainModelUpdatedEventHandler.cs b/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/UserRoleAssignment/DomainModelUpdatedEventHandler.cs index 8ded0e7c..6c5bbb3a 100644 --- a/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/UserRoleAssignment/DomainModelUpdatedEventHandler.cs +++ b/example/RapidField.SolidInstruments.Example.Domain.Identity/EventHandlers/ModelState/UserRoleAssignment/DomainModelUpdatedEventHandler.cs @@ -2,7 +2,6 @@ // Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. // ================================================================================================================================= -using Microsoft.AspNetCore.Identity; using RapidField.SolidInstruments.Command; using RapidField.SolidInstruments.Core.ArgumentValidation; using RapidField.SolidInstruments.Core.Concurrency; @@ -71,7 +70,7 @@ protected override void Process(DomainModel model, IEnumerable labels, G if (identityUserRole is null) { - identityUserRole = new IdentityUserRole() + identityUserRole = new() { RoleId = model.UserRoleIdentifier.ToString(), UserId = model.UserIdentifier.ToString() diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/AggregateDataAccessModel.Navigation.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/AggregateDataAccessModel.Navigation.cs index b2703d17..a1a15ae8 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Models/User/AggregateDataAccessModel.Navigation.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/AggregateDataAccessModel.Navigation.cs @@ -44,7 +44,7 @@ public ICollection UserRoleAssignments { if (UserRoleAssignmentsList is null) { - UserRoleAssignmentsList = new List(); + UserRoleAssignmentsList = new(); } return UserRoleAssignmentsList; diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.Logic.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.Logic.cs index 88be84e7..0b1eaf6c 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.Logic.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.Logic.cs @@ -5,7 +5,6 @@ using RapidField.SolidInstruments.Core.ArgumentValidation; using System; using System.Linq; -using UserRoleAssignmentModel = RapidField.SolidInstruments.Example.Domain.Models.UserRoleAssignment.DomainModel; using UserRoleModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; namespace RapidField.SolidInstruments.Example.Domain.Models.User @@ -43,7 +42,7 @@ public void AssignRole(UserRoleModel userRole) return; } - UserRoleAssignments.Add(new UserRoleAssignmentModel(Guid.NewGuid()) + UserRoleAssignments.Add(new(Guid.NewGuid()) { User = this, UserRole = userRole diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.Navigation.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.Navigation.cs index 49bf0a25..ec6aee8a 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.Navigation.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.Navigation.cs @@ -44,7 +44,7 @@ public ICollection UserRoleAssignments { if (UserRoleAssignmentsList is null) { - UserRoleAssignmentsList = new List(); + UserRoleAssignmentsList = new(); } return UserRoleAssignmentsList; diff --git a/src/RapidField.SolidInstruments.Collections/InfiniteSequence.cs b/src/RapidField.SolidInstruments.Collections/InfiniteSequence.cs index c87ed36e..8603043c 100644 --- a/src/RapidField.SolidInstruments.Collections/InfiniteSequence.cs +++ b/src/RapidField.SolidInstruments.Collections/InfiniteSequence.cs @@ -144,7 +144,7 @@ public void Reset() { lock (SyncRoot) { - CalculatedTerms = new List(CalculatedTerms.Take(SeedTermCount)); + CalculatedTerms = new(CalculatedTerms.Take(SeedTermCount)); } } diff --git a/src/RapidField.SolidInstruments.Collections/PinnedMemory.cs b/src/RapidField.SolidInstruments.Collections/PinnedMemory.cs index 0ce270e3..8085f0e0 100644 --- a/src/RapidField.SolidInstruments.Collections/PinnedMemory.cs +++ b/src/RapidField.SolidInstruments.Collections/PinnedMemory.cs @@ -198,7 +198,7 @@ public PinnedMemory(T[] field, Boolean overwriteWithZerosOnDispose) /// /// The object to cast from. /// - public static implicit operator PinnedMemory(T[] target) => target is null ? null : new PinnedMemory(target); + public static implicit operator PinnedMemory(T[] target) => target is null ? null : new(target); /// /// Facilitates implicit to casting. diff --git a/src/RapidField.SolidInstruments.Collections/ReadOnlyPinnedMemory.cs b/src/RapidField.SolidInstruments.Collections/ReadOnlyPinnedMemory.cs index c0135818..c43511f4 100644 --- a/src/RapidField.SolidInstruments.Collections/ReadOnlyPinnedMemory.cs +++ b/src/RapidField.SolidInstruments.Collections/ReadOnlyPinnedMemory.cs @@ -128,7 +128,7 @@ public ReadOnlyPinnedMemory(T[] field) /// /// The object to cast from. /// - public static implicit operator ReadOnlyPinnedMemory(T[] target) => target is null ? null : new ReadOnlyPinnedMemory(target); + public static implicit operator ReadOnlyPinnedMemory(T[] target) => target is null ? null : new(target); /// /// Facilitates implicit to casting. diff --git a/src/RapidField.SolidInstruments.Core/Extensions/LazyExtensions.cs b/src/RapidField.SolidInstruments.Core/Extensions/LazyExtensions.cs index 240683cc..8e9c86f2 100644 --- a/src/RapidField.SolidInstruments.Core/Extensions/LazyExtensions.cs +++ b/src/RapidField.SolidInstruments.Core/Extensions/LazyExtensions.cs @@ -21,7 +21,7 @@ public static class LazyExtensions public static void Dispose(this Lazy target) where T : IDisposable { - if ((target?.IsValueCreated).GetValueOrDefault(false)) + if (target?.IsValueCreated ?? false) { target.Value.Dispose(); } @@ -36,7 +36,7 @@ public static void Dispose(this Lazy target) public static Task DisposeAsync(this Lazy target) where T : IAsyncDisposable { - if ((target?.IsValueCreated).GetValueOrDefault(false)) + if (target?.IsValueCreated ?? false) { return target.Value.DisposeAsync().AsTask(); } diff --git a/src/RapidField.SolidInstruments.Core/Model.cs b/src/RapidField.SolidInstruments.Core/Model.cs index 14c02cbe..062948d6 100644 --- a/src/RapidField.SolidInstruments.Core/Model.cs +++ b/src/RapidField.SolidInstruments.Core/Model.cs @@ -368,7 +368,7 @@ private static void HydrateModel(IModel sourceModel, IModel targetModel, MappedM var targetModelType = targetModel.RejectIf().IsNull(nameof(targetModel)).TargetArgument.GetType(); var sourceModelProperties = sourceModelType.GetProperties(PropertyBindingFlags).ToDictionary(property => property.Name, property => property); var targetModelProperties = targetModelType.GetProperties(PropertyBindingFlags).ToDictionary(property => property.Name, property => property); - mappedModels.RejectIf().IsNull(nameof(mappedModels)).TargetArgument.AddModelPair(new MappedModel(sourceModel, targetModel)); + mappedModels.RejectIf().IsNull(nameof(mappedModels)).TargetArgument.AddModelPair(new(sourceModel, targetModel)); foreach (var sourcePropertyElement in sourceModelProperties) { diff --git a/src/RapidField.SolidInstruments.Core/ReferenceManager.cs b/src/RapidField.SolidInstruments.Core/ReferenceManager.cs index 8c569d14..1b5a971b 100644 --- a/src/RapidField.SolidInstruments.Core/ReferenceManager.cs +++ b/src/RapidField.SolidInstruments.Core/ReferenceManager.cs @@ -403,7 +403,7 @@ private T Target set { StrongReference = value; - WeakReference = value is null ? null : new WeakReference(value); + WeakReference = value is null ? null : new(value); } } diff --git a/src/RapidField.SolidInstruments.Cryptography/CryptographicKey.cs b/src/RapidField.SolidInstruments.Cryptography/CryptographicKey.cs index cd8dc1ee..6bc56ebb 100644 --- a/src/RapidField.SolidInstruments.Cryptography/CryptographicKey.cs +++ b/src/RapidField.SolidInstruments.Cryptography/CryptographicKey.cs @@ -322,7 +322,7 @@ private Rfc2898DeriveBytes InitializePbkdf2Algorithm() iterationCount += iterationSumValue; } - algorithm = new Rfc2898DeriveBytes(passwordBytes.ToArray(), saltBytes.ToArray(), iterationCount); + algorithm = new(passwordBytes.ToArray(), saltBytes.ToArray(), iterationCount); }); return algorithm; diff --git a/src/RapidField.SolidInstruments.Cryptography/Extensions/RandomNumberGeneratorExtensions.cs b/src/RapidField.SolidInstruments.Cryptography/Extensions/RandomNumberGeneratorExtensions.cs index 8be45275..f705c1bd 100644 --- a/src/RapidField.SolidInstruments.Cryptography/Extensions/RandomNumberGeneratorExtensions.cs +++ b/src/RapidField.SolidInstruments.Cryptography/Extensions/RandomNumberGeneratorExtensions.cs @@ -2207,7 +2207,7 @@ private static void GenerateUInt64(RandomNumberGenerator target, out UInt64 rand [DebuggerHidden] private static void GenerateUInt64(RandomNumberGenerator target, UInt64 floor, UInt64 ceiling, out UInt64 randomValue) { - var range = BigInteger.Subtract(new BigInteger(ceiling), new BigInteger(floor)); + var range = BigInteger.Subtract(new(ceiling), new(floor)); GenerateRangePosition(target, (Decimal)range, out var rangePosition); randomValue = Convert.ToUInt64(floor + rangePosition.RoundedTo(0)); } diff --git a/src/RapidField.SolidInstruments.Cryptography/Hashing/HashTree.cs b/src/RapidField.SolidInstruments.Cryptography/Hashing/HashTree.cs index 2a1c6dd4..5c429eea 100644 --- a/src/RapidField.SolidInstruments.Cryptography/Hashing/HashTree.cs +++ b/src/RapidField.SolidInstruments.Cryptography/Hashing/HashTree.cs @@ -223,7 +223,7 @@ private Byte[] CalculateHash(Byte[] firstHashValue, Byte[] secondHashValue) /// The new node. /// [DebuggerHidden] - private HashTreeNode CreateNode(HashTreeNode leftChild, HashTreeNode rightChild) => new HashTreeNode(CalculateHash(leftChild.Value, rightChild.Value), leftChild, rightChild); + private HashTreeNode CreateNode(HashTreeNode leftChild, HashTreeNode rightChild) => new(CalculateHash(leftChild.Value, rightChild.Value), leftChild, rightChild); /// /// Processes the specified row in the tree recursively toward the root node. diff --git a/src/RapidField.SolidInstruments.Cryptography/Secrets/ExportedSecretVault.cs b/src/RapidField.SolidInstruments.Cryptography/Secrets/ExportedSecretVault.cs index b2b06c47..bf127a32 100644 --- a/src/RapidField.SolidInstruments.Cryptography/Secrets/ExportedSecretVault.cs +++ b/src/RapidField.SolidInstruments.Cryptography/Secrets/ExportedSecretVault.cs @@ -45,7 +45,7 @@ internal ExportedSecretVault(String identifier, IEnumerable secr : base() { Identifier = identifier.RejectIf().IsNullOrEmpty(nameof(identifier)); - Secrets = new List(secrets.RejectIf().IsNull(nameof(secrets)).OrIf(collection => collection.Any(secret => secret is null), nameof(secrets), "The specified secret collection contains one or more null elements.").TargetArgument); + Secrets = new(secrets.RejectIf().IsNull(nameof(secrets)).OrIf(collection => collection.Any(secret => secret is null), nameof(secrets), "The specified secret collection contains one or more null elements.").TargetArgument); } /// diff --git a/src/RapidField.SolidInstruments.Cryptography/Secrets/SecretVault.cs b/src/RapidField.SolidInstruments.Cryptography/Secrets/SecretVault.cs index 9f33b886..92382b16 100644 --- a/src/RapidField.SolidInstruments.Cryptography/Secrets/SecretVault.cs +++ b/src/RapidField.SolidInstruments.Cryptography/Secrets/SecretVault.cs @@ -1223,14 +1223,14 @@ private static async Task ExportEncryptedSecretAsync(Ex { await ((SymmetricKeySecret)keySecret).ReadAsync((SymmetricKey key) => { - encryptedExportedSecret = new EncryptedExportedSecret(exportedSecret, key, keyName); + encryptedExportedSecret = new(exportedSecret, key, keyName); }).ConfigureAwait(false); } else if (keySecret.ValueType == typeof(CascadingSymmetricKey)) { await ((CascadingSymmetricKeySecret)keySecret).ReadAsync((CascadingSymmetricKey key) => { - encryptedExportedSecret = new EncryptedExportedSecret(exportedSecret, key, keyName); + encryptedExportedSecret = new(exportedSecret, key, keyName); }).ConfigureAwait(false); } @@ -1262,14 +1262,14 @@ private static async Task ExportEncryptedSecretVau { await ((SymmetricKeySecret)keySecret).ReadAsync((SymmetricKey key) => { - encryptedExportedSecretVault = new EncryptedExportedSecretVault(exportedSecretVault, key, keyName); + encryptedExportedSecretVault = new(exportedSecretVault, key, keyName); }).ConfigureAwait(false); } else if (keySecret.ValueType == typeof(CascadingSymmetricKey)) { await ((CascadingSymmetricKeySecret)keySecret).ReadAsync((CascadingSymmetricKey key) => { - encryptedExportedSecretVault = new EncryptedExportedSecretVault(exportedSecretVault, key, keyName); + encryptedExportedSecretVault = new(exportedSecretVault, key, keyName); }).ConfigureAwait(false); } diff --git a/src/RapidField.SolidInstruments.InversionOfControl.Autofac/AutofacDependencyEngine.cs b/src/RapidField.SolidInstruments.InversionOfControl.Autofac/AutofacDependencyEngine.cs index 55fd2d71..25bdeb93 100644 --- a/src/RapidField.SolidInstruments.InversionOfControl.Autofac/AutofacDependencyEngine.cs +++ b/src/RapidField.SolidInstruments.InversionOfControl.Autofac/AutofacDependencyEngine.cs @@ -108,6 +108,6 @@ internal static AutofacDependencyEngine New(IConfiguration application /// /// A new service injector. /// - protected override AutofacServiceInjector CreateServiceInjector(IServiceCollection serviceDescriptors) => new AutofacServiceInjector(serviceDescriptors); + protected override AutofacServiceInjector CreateServiceInjector(IServiceCollection serviceDescriptors) => new(serviceDescriptors); } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.InversionOfControl.Autofac/AutofacDependencyPackage.cs b/src/RapidField.SolidInstruments.InversionOfControl.Autofac/AutofacDependencyPackage.cs index d11910c3..5a08d5a6 100644 --- a/src/RapidField.SolidInstruments.InversionOfControl.Autofac/AutofacDependencyPackage.cs +++ b/src/RapidField.SolidInstruments.InversionOfControl.Autofac/AutofacDependencyPackage.cs @@ -41,6 +41,6 @@ protected AutofacDependencyPackage() /// is -or- is /// -or- is . /// - protected sealed override AutofacDependencyEngine CreateEngine(IConfiguration applicationConfiguration, IServiceCollection serviceDescriptors, IDependencyPackage package) => new AutofacDependencyEngine(applicationConfiguration, package, serviceDescriptors); + protected sealed override AutofacDependencyEngine CreateEngine(IConfiguration applicationConfiguration, IServiceCollection serviceDescriptors, IDependencyPackage package) => new(applicationConfiguration, package, serviceDescriptors); } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.InversionOfControl.DotNetNative/DotNetNativeDependencyEngine.cs b/src/RapidField.SolidInstruments.InversionOfControl.DotNetNative/DotNetNativeDependencyEngine.cs index 59539883..51722465 100644 --- a/src/RapidField.SolidInstruments.InversionOfControl.DotNetNative/DotNetNativeDependencyEngine.cs +++ b/src/RapidField.SolidInstruments.InversionOfControl.DotNetNative/DotNetNativeDependencyEngine.cs @@ -107,6 +107,6 @@ internal static DotNetNativeDependencyEngine New(IConfiguration applic /// /// A new service injector. /// - protected override DotNetNativeServiceInjector CreateServiceInjector(IServiceCollection serviceDescriptors) => new DotNetNativeServiceInjector(serviceDescriptors); + protected override DotNetNativeServiceInjector CreateServiceInjector(IServiceCollection serviceDescriptors) => new(serviceDescriptors); } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.InversionOfControl.DotNetNative/DotNetNativeDependencyPackage.cs b/src/RapidField.SolidInstruments.InversionOfControl.DotNetNative/DotNetNativeDependencyPackage.cs index d3aaaa02..0d7bfa28 100644 --- a/src/RapidField.SolidInstruments.InversionOfControl.DotNetNative/DotNetNativeDependencyPackage.cs +++ b/src/RapidField.SolidInstruments.InversionOfControl.DotNetNative/DotNetNativeDependencyPackage.cs @@ -40,6 +40,6 @@ protected DotNetNativeDependencyPackage() /// is -or- is /// -or- is . /// - protected sealed override DotNetNativeDependencyEngine CreateEngine(IConfiguration applicationConfiguration, IServiceCollection serviceDescriptors, IDependencyPackage package) => new DotNetNativeDependencyEngine(applicationConfiguration, package, serviceDescriptors); + protected sealed override DotNetNativeDependencyEngine CreateEngine(IConfiguration applicationConfiguration, IServiceCollection serviceDescriptors, IDependencyPackage package) => new(applicationConfiguration, package, serviceDescriptors); } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.Mathematics/Statistics/Extensions/IEnumerableExtensions.cs b/src/RapidField.SolidInstruments.Mathematics/Statistics/Extensions/IEnumerableExtensions.cs index c93e157d..71a43f7f 100644 --- a/src/RapidField.SolidInstruments.Mathematics/Statistics/Extensions/IEnumerableExtensions.cs +++ b/src/RapidField.SolidInstruments.Mathematics/Statistics/Extensions/IEnumerableExtensions.cs @@ -1666,12 +1666,12 @@ private static Int32[] DetermineMedianIndices(Int32 elementCount) else if (elementCount.IsOdd()) { // Return the index at the midpoint. - return new Int32[] { Convert.ToInt32(Math.Round((Single)(elementCount / 2), 0, MidpointRounding.AwayFromZero)) }; + return new[] { Convert.ToInt32(Math.Round((Single)(elementCount / 2), 0, MidpointRounding.AwayFromZero)) }; } // Return the pair of indices sharing the midpoint. var firstIndex = (elementCount / 2) - 1; - return new Int32[] { firstIndex, firstIndex + 1 }; + return new[] { firstIndex, firstIndex + 1 }; } /// diff --git a/src/RapidField.SolidInstruments.Messaging/CommandMessages/CommandMessage.cs b/src/RapidField.SolidInstruments.Messaging/CommandMessages/CommandMessage.cs index 492e83b9..c97ce038 100644 --- a/src/RapidField.SolidInstruments.Messaging/CommandMessages/CommandMessage.cs +++ b/src/RapidField.SolidInstruments.Messaging/CommandMessages/CommandMessage.cs @@ -206,7 +206,7 @@ public abstract class CommandMessage : Message, ICommandMessage class. /// protected CommandMessage() - : this(new TCommand()) + : this(new()) { return; } diff --git a/src/RapidField.SolidInstruments.Messaging/MessageProcessingInformation.cs b/src/RapidField.SolidInstruments.Messaging/MessageProcessingInformation.cs index 2082fbfb..b7ece256 100644 --- a/src/RapidField.SolidInstruments.Messaging/MessageProcessingInformation.cs +++ b/src/RapidField.SolidInstruments.Messaging/MessageProcessingInformation.cs @@ -41,7 +41,7 @@ public MessageProcessingInformation() /// public MessageProcessingInformation(MessageListeningFailurePolicy failurePolicy) { - AttemptResults = new List(); + AttemptResults = new(); FailurePolicy = failurePolicy.RejectIf().IsNull(nameof(failurePolicy)); } diff --git a/src/RapidField.SolidInstruments.Messaging/TransportPrimitives/MessageTransportConnection.cs b/src/RapidField.SolidInstruments.Messaging/TransportPrimitives/MessageTransportConnection.cs index 93ac8a98..f503f8e3 100644 --- a/src/RapidField.SolidInstruments.Messaging/TransportPrimitives/MessageTransportConnection.cs +++ b/src/RapidField.SolidInstruments.Messaging/TransportPrimitives/MessageTransportConnection.cs @@ -95,7 +95,7 @@ public void RegisterQueueHandler(IMessagingEntityPath queuePath, Action(Func prod throw new ArgumentException($"The builder is already configured for the request-product type pair: {requestType.FullName}, {productType.FullName}.", nameof(TProduct)); } - DefinitionConfigurationActions.Add(definitionKey, new Action((definitions) => + DefinitionConfigurationActions.Add(definitionKey, new((definitions) => { definitions.Add(); })); @@ -138,7 +138,7 @@ public IObjectContainerBuilder Configure(Func prod return this; } - FunctionConfigurationActions.Add(definitionKey, new Action((functions) => + FunctionConfigurationActions.Add(definitionKey, new((functions) => { functions.Add(productionFunction); })); diff --git a/src/RapidField.SolidInstruments.Serialization/DynamicSerializer.cs b/src/RapidField.SolidInstruments.Serialization/DynamicSerializer.cs index 53853762..5ac88845 100644 --- a/src/RapidField.SolidInstruments.Serialization/DynamicSerializer.cs +++ b/src/RapidField.SolidInstruments.Serialization/DynamicSerializer.cs @@ -149,7 +149,7 @@ public DynamicSerializer(SerializationFormat format) /// An XML serializer. /// [DebuggerHidden] - private static DataContractJsonSerializer InitializeJsonSerializer() => new DataContractJsonSerializer(ContractType, JsonSerializerSettings); + private static DataContractJsonSerializer InitializeJsonSerializer() => new(ContractType, JsonSerializerSettings); /// /// Initializes an XML serializer. @@ -158,7 +158,7 @@ public DynamicSerializer(SerializationFormat format) /// An XML serializer. /// [DebuggerHidden] - private static DataContractSerializer InitializeXmlSerializer() => new DataContractSerializer(ContractType, XmlSerializerSettings); + private static DataContractSerializer InitializeXmlSerializer() => new(ContractType, XmlSerializerSettings); /// /// Converts the specified JSON bit field to its typed equivalent. diff --git a/src/RapidField.SolidInstruments.Service/ServiceExecutionLifetime.cs b/src/RapidField.SolidInstruments.Service/ServiceExecutionLifetime.cs index e8889424..1b5aec09 100644 --- a/src/RapidField.SolidInstruments.Service/ServiceExecutionLifetime.cs +++ b/src/RapidField.SolidInstruments.Service/ServiceExecutionLifetime.cs @@ -108,6 +108,6 @@ public Boolean IsAlive /// Represents an event that can be triggered to signal the end of an associated service's lifetime. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly ManualResetEvent EndOfLifeEvent = new ManualResetEvent(false); + private readonly ManualResetEvent EndOfLifeEvent = new(false); } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.Web.Autofac/AutofacWebExecutor.cs b/src/RapidField.SolidInstruments.Web.Autofac/AutofacWebExecutor.cs index 98ac70fb..ffd450bd 100644 --- a/src/RapidField.SolidInstruments.Web.Autofac/AutofacWebExecutor.cs +++ b/src/RapidField.SolidInstruments.Web.Autofac/AutofacWebExecutor.cs @@ -50,7 +50,7 @@ protected AutofacWebExecutor(String applicationName) /// /// The service provider factory. /// - protected sealed override AutofacServiceProviderFactory CreateServiceProviderFactory(IConfiguration applicationConfiguration) => new AutofacServiceProviderFactory(applicationConfiguration); + protected sealed override AutofacServiceProviderFactory CreateServiceProviderFactory(IConfiguration applicationConfiguration) => new(applicationConfiguration); /// /// Releases all resources consumed by the current . @@ -97,7 +97,7 @@ protected AutofacWebExecutor(String applicationName) /// /// The service provider factory. /// - protected sealed override AutofacServiceProviderFactory CreateServiceProviderFactory(IConfiguration applicationConfiguration) => new AutofacServiceProviderFactory(applicationConfiguration); + protected sealed override AutofacServiceProviderFactory CreateServiceProviderFactory(IConfiguration applicationConfiguration) => new(applicationConfiguration); /// /// Releases all resources consumed by the current . diff --git a/src/RapidField.SolidInstruments.Web.DotNetNative/DotNetNativeWebExecutor.cs b/src/RapidField.SolidInstruments.Web.DotNetNative/DotNetNativeWebExecutor.cs index ee9e4b73..0094fc67 100644 --- a/src/RapidField.SolidInstruments.Web.DotNetNative/DotNetNativeWebExecutor.cs +++ b/src/RapidField.SolidInstruments.Web.DotNetNative/DotNetNativeWebExecutor.cs @@ -65,7 +65,7 @@ protected DotNetNativeWebExecutor(String applicationName) /// /// The service provider factory. /// - protected sealed override DotNetNativeServiceProviderFactory CreateServiceProviderFactory(IConfiguration applicationConfiguration) => new DotNetNativeServiceProviderFactory(applicationConfiguration); + protected sealed override DotNetNativeServiceProviderFactory CreateServiceProviderFactory(IConfiguration applicationConfiguration) => new(applicationConfiguration); /// /// Releases all resources consumed by the current . @@ -126,7 +126,7 @@ protected DotNetNativeWebExecutor(String applicationName) /// /// The service provider factory. /// - protected sealed override DotNetNativeServiceProviderFactory CreateServiceProviderFactory(IConfiguration applicationConfiguration) => new DotNetNativeServiceProviderFactory(applicationConfiguration); + protected sealed override DotNetNativeServiceProviderFactory CreateServiceProviderFactory(IConfiguration applicationConfiguration) => new(applicationConfiguration); /// /// Releases all resources consumed by the current . diff --git a/test/RapidField.SolidInstruments.Core.UnitTests/SimulatedModel.cs b/test/RapidField.SolidInstruments.Core.UnitTests/SimulatedModel.cs index ec02e7d9..05181a5a 100644 --- a/test/RapidField.SolidInstruments.Core.UnitTests/SimulatedModel.cs +++ b/test/RapidField.SolidInstruments.Core.UnitTests/SimulatedModel.cs @@ -106,8 +106,8 @@ public SimulatedModel(TimeOfDay time, IEnumerable integerCollection, IEnu public SimulatedModel(TimeOfDay time, IEnumerable integerCollection, IEnumerable modelCollection, String stringValue) : base() { - IntegerCollection = new List(integerCollection.RejectIf().IsNull(nameof(integerCollection)).TargetArgument); - ModelCollection = new List(modelCollection.RejectIf().IsNull(nameof(modelCollection)).TargetArgument); + IntegerCollection = new(integerCollection.RejectIf().IsNull(nameof(integerCollection)).TargetArgument); + ModelCollection = new(modelCollection.RejectIf().IsNull(nameof(modelCollection)).TargetArgument); StringValue = stringValue; Time = time.RejectIf().IsNull(nameof(time)); } @@ -250,7 +250,7 @@ private void RandomlyModifyTime(RandomNumberGenerator randomnessProvider) var hour = randomnessProvider.GetInt32(0, 23); var minute = randomnessProvider.GetInt32(0, 59); var second = randomnessProvider.GetInt32(0, 59); - Time = new TimeOfDay(TimeZoneInfo.Utc, hour, minute, second); + Time = new(TimeZoneInfo.Utc, hour, minute, second); } /// diff --git a/test/RapidField.SolidInstruments.Cryptography.UnitTests/SimulatedModel.cs b/test/RapidField.SolidInstruments.Cryptography.UnitTests/SimulatedModel.cs index 5763bc38..a7c5d497 100644 --- a/test/RapidField.SolidInstruments.Cryptography.UnitTests/SimulatedModel.cs +++ b/test/RapidField.SolidInstruments.Cryptography.UnitTests/SimulatedModel.cs @@ -106,8 +106,8 @@ public SimulatedModel(TimeOfDay time, IEnumerable integerCollection, IEnu public SimulatedModel(TimeOfDay time, IEnumerable integerCollection, IEnumerable modelCollection, String stringValue) : base() { - IntegerCollection = new List(integerCollection.RejectIf().IsNull(nameof(integerCollection)).TargetArgument); - ModelCollection = new List(modelCollection.RejectIf().IsNull(nameof(modelCollection)).TargetArgument); + IntegerCollection = new(integerCollection.RejectIf().IsNull(nameof(integerCollection)).TargetArgument); + ModelCollection = new(modelCollection.RejectIf().IsNull(nameof(modelCollection)).TargetArgument); StringValue = stringValue; Time = time.RejectIf().IsNull(nameof(time)); } diff --git a/test/RapidField.SolidInstruments.DataAccess.EntityFramework.UnitTests/CommandHandlers/AddFibonacciNumberCommandHandler.cs b/test/RapidField.SolidInstruments.DataAccess.EntityFramework.UnitTests/CommandHandlers/AddFibonacciNumberCommandHandler.cs index 74980540..1f15b4fc 100644 --- a/test/RapidField.SolidInstruments.DataAccess.EntityFramework.UnitTests/CommandHandlers/AddFibonacciNumberCommandHandler.cs +++ b/test/RapidField.SolidInstruments.DataAccess.EntityFramework.UnitTests/CommandHandlers/AddFibonacciNumberCommandHandler.cs @@ -69,7 +69,7 @@ protected override void Process(AddFibonacciNumberCommand command, ICommandMedia if (number is null) { - number = new Number() + number = new() { Identifier = Guid.NewGuid(), Value = command.NumberValue @@ -83,7 +83,7 @@ protected override void Process(AddFibonacciNumberCommand command, ICommandMedia if (numberSeriesNumber is null) { - numberSeriesNumber = new NumberSeriesNumber() + numberSeriesNumber = new() { Identifier = Guid.NewGuid(), Number = number, diff --git a/test/RapidField.SolidInstruments.DataAccess.UnitTests/SimulatedRepositoryFactory.cs b/test/RapidField.SolidInstruments.DataAccess.UnitTests/SimulatedRepositoryFactory.cs index 14ddfd04..8533d9f4 100644 --- a/test/RapidField.SolidInstruments.DataAccess.UnitTests/SimulatedRepositoryFactory.cs +++ b/test/RapidField.SolidInstruments.DataAccess.UnitTests/SimulatedRepositoryFactory.cs @@ -54,11 +54,11 @@ protected override void Configure(ObjectFactoryConfiguration configuration) /// /// Represents a store for data. /// - private static SimulatedBarDataStore BarData => new SimulatedBarDataStore(new Int32[] { 1, 2, 3, 4, 5 }); + private static SimulatedBarDataStore BarData => new(new Int32[] { 1, 2, 3, 4, 5 }); /// /// Represents a store for data. /// - private static SimulatedFooDataStore FooData => new SimulatedFooDataStore(new String[] { "foo1", "foo2", "foo3", "foo4", "foo5" }); + private static SimulatedFooDataStore FooData => new(new String[] { "foo1", "foo2", "foo3", "foo4", "foo5" }); } } \ No newline at end of file