diff --git a/.editorconfig b/.editorconfig
index 5325ea92..50a8ac8e 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -38,10 +38,10 @@ dotnet_style_predefined_type_for_locals_parameters_members = false : error
dotnet_style_predefined_type_for_member_access = false : error
# Parentheses preferences
-dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity : silent
-dotnet_style_parentheses_in_other_binary_operators = always_for_clarity : silent
-dotnet_style_parentheses_in_other_operators = never_if_unnecessary : silent
-dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity : silent
+dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity : suggestion
+dotnet_style_parentheses_in_other_binary_operators = always_for_clarity : suggestion
+dotnet_style_parentheses_in_other_operators = never_if_unnecessary : suggestion
+dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity : suggestion
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members : silent
@@ -231,4 +231,19 @@ dotnet_diagnostic.CA1027.severity = silent
dotnet_diagnostic.CA1031.severity = silent
# IDE0075: Simplify conditional expression
-dotnet_style_prefer_simplified_boolean_expressions = false : none
\ No newline at end of file
+dotnet_style_prefer_simplified_boolean_expressions = false : none
+
+# PH_S002: Monitor Discouraged Sync Object
+dotnet_diagnostic.PH_S002.severity = none
+
+# PH_S005: Fake-Async Methods
+dotnet_diagnostic.PH_S005.severity = none
+
+# PH_B007: Non-Atomic Access to Concurrent Collection
+dotnet_diagnostic.PH_B007.severity = silent
+
+# PH_P006: Discouraged Monitor Method
+dotnet_diagnostic.PH_P006.severity = silent
+
+# PH_P007: Unused Cancellation Token
+dotnet_diagnostic.PH_P007.severity = silent
\ No newline at end of file
diff --git a/RapidField.SolidInstruments.sln b/RapidField.SolidInstruments.sln
index 49c401c9..47b95e96 100644
--- a/RapidField.SolidInstruments.sln
+++ b/RapidField.SolidInstruments.sln
@@ -399,6 +399,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RapidField.SolidInstruments
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RapidField.SolidInstruments.DataAccess.DotNetNative.Ef", "src\RapidField.SolidInstruments.DataAccess.DotNetNative.Ef\RapidField.SolidInstruments.DataAccess.DotNetNative.Ef.csproj", "{F20759D5-D39D-4C31-8A23-AEAA606776E6}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RapidField.SolidInstruments.Example.Domain.AccessControl", "example\RapidField.SolidInstruments.Example.Domain.AccessControl\RapidField.SolidInstruments.Example.Domain.AccessControl.csproj", "{7B185E3A-3A26-4188-9FB4-DED7E4EF5C3D}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -613,6 +615,10 @@ Global
{F20759D5-D39D-4C31-8A23-AEAA606776E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F20759D5-D39D-4C31-8A23-AEAA606776E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F20759D5-D39D-4C31-8A23-AEAA606776E6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7B185E3A-3A26-4188-9FB4-DED7E4EF5C3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7B185E3A-3A26-4188-9FB4-DED7E4EF5C3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7B185E3A-3A26-4188-9FB4-DED7E4EF5C3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7B185E3A-3A26-4188-9FB4-DED7E4EF5C3D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -686,6 +692,7 @@ Global
{8FFB8E4C-5858-4D18-B8DA-D669EED643AB} = {F58E05BE-9DC6-41B4-8324-C006F6CE7CC7}
{266AC8D7-BDA0-42B0-B473-9025EDEB8DF8} = {F58E05BE-9DC6-41B4-8324-C006F6CE7CC7}
{F20759D5-D39D-4C31-8A23-AEAA606776E6} = {F58E05BE-9DC6-41B4-8324-C006F6CE7CC7}
+ {7B185E3A-3A26-4188-9FB4-DED7E4EF5C3D} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {834FCFB0-DA00-4ABD-9424-6FE1398A9F6E}
diff --git a/en-US_User.dic b/en-US_User.dic
index 2a643767..814500ed 100644
--- a/en-US_User.dic
+++ b/en-US_User.dic
@@ -8,6 +8,7 @@ apidoc
appveyor
assignees
astextplain
+Async
atm
Autofac
backmerge
diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/AssemblyAttributes.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/AssemblyAttributes.cs
new file mode 100644
index 00000000..a32e4acd
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/AssemblyAttributes.cs
@@ -0,0 +1,7 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using System.Runtime.CompilerServices;
+
+[assembly: DisablePrivateReflection()]
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/README.md b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/README.md
new file mode 100644
index 00000000..be347761
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/README.md
@@ -0,0 +1,30 @@
+
+
+[![Solid Instruments](../../SolidInstruments.Logo.Color.Transparent.500w.png)](../../README.md)
+- - -
+
+# RapidField.SolidInstruments.Example.Domain
+
+This document describes the purpose of the [`RapidField.SolidInstruments.Example.Domain.AccessControl`]() project.
+
+## Purpose
+
+This project demonstrates access control domain logic utilizing the **Solid Instruments** [data access](../../src/RapidField.SolidInstruments.DataAccess/README.md) and [messaging](../../src/RapidField.SolidInstruments.Messaging/README.md) constructs.
+
+## License
+
+[![License](https://img.shields.io/github/license/rapidfield/solid-instruments?style=flat&color=lightseagreen&label=license&logo=open-access&logoColor=lightgrey)](../../LICENSE.txt)
+
+**Solid Instruments** is [MIT-licensed](https://en.wikipedia.org/wiki/MIT_License). Review the [license terms](../../LICENSE.txt) for more information.
+
+
+
+- - -
+
+
+
+[![RapidField](../../RapidField.Logo.Color.Black.Transparent.200w.png)](https://www.rapidfield.com)
+
+###### Copyright (c) RapidField LLC. All rights reserved. "RapidField" and "Solid Instruments" are trademarks of RapidField LLC.
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/RapidField.SolidInstruments.Example.Domain.AccessControl.csproj b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/RapidField.SolidInstruments.Example.Domain.AccessControl.csproj
new file mode 100644
index 00000000..81c381fb
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/RapidField.SolidInstruments.Example.Domain.AccessControl.csproj
@@ -0,0 +1,35 @@
+
+
+
+
+ Solid Instruments contributors
+ RapidField
+ Copyright (c) RapidField LLC. All rights reserved.
+ Solid Instruments
+ This project demonstrates access control domain logic utilizing the Solid Instruments data access and messaging constructs.
+ $(BuildVersion)
+ netstandard2.1
+ latest
+
+
+ bin\Debug\netstandard2.1\RapidField.SolidInstruments.Example.Domain.AccessControl.xml
+ true
+
+
+
+ bin\Release\netstandard2.1\RapidField.SolidInstruments.Example.Domain.AccessControl.xml
+ true
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/CreateDomainModelCommand.cs b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/CreateDomainModelCommand.cs
new file mode 100644
index 00000000..53e9c347
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/CreateDomainModelCommand.cs
@@ -0,0 +1,129 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.EventAuthoring;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelCreatedEvent;
+
+namespace RapidField.SolidInstruments.Example.Domain.Commands.ModelState.User
+{
+ ///
+ /// Represents a command to create a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class CreateDomainModelCommand : CreateDomainModelReportableCommand
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public CreateDomainModelCommand()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A unique identifier that is assigned to related commands.
+ ///
+ ///
+ /// is equal to .
+ ///
+ public CreateDomainModelCommand(Guid correlationIdentifier)
+ : base(correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// is .
+ ///
+ public CreateDomainModelCommand(DomainModel model)
+ : base(model)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// A unique identifier that is assigned to related commands.
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public CreateDomainModelCommand(DomainModel model, Guid correlationIdentifier)
+ : base(model, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the command.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ public CreateDomainModelCommand(DomainModel model, IEnumerable labels)
+ : base(model, labels)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the command.
+ ///
+ ///
+ /// A unique identifier that is assigned to related commands.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public CreateDomainModelCommand(DomainModel model, IEnumerable labels, Guid correlationIdentifier)
+ : base(model, labels, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "CreateUserEvent";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/DeleteDomainModelCommand.cs b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/DeleteDomainModelCommand.cs
new file mode 100644
index 00000000..7106af34
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/DeleteDomainModelCommand.cs
@@ -0,0 +1,129 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.EventAuthoring;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelDeletedEvent;
+
+namespace RapidField.SolidInstruments.Example.Domain.Commands.ModelState.User
+{
+ ///
+ /// Represents a command to delete a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class DeleteDomainModelCommand : DeleteDomainModelReportableCommand
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DeleteDomainModelCommand()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A unique identifier that is assigned to related commands.
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DeleteDomainModelCommand(Guid correlationIdentifier)
+ : base(correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// is .
+ ///
+ public DeleteDomainModelCommand(DomainModel model)
+ : base(model)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// A unique identifier that is assigned to related commands.
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DeleteDomainModelCommand(DomainModel model, Guid correlationIdentifier)
+ : base(model, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the command.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ public DeleteDomainModelCommand(DomainModel model, IEnumerable labels)
+ : base(model, labels)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the command.
+ ///
+ ///
+ /// A unique identifier that is assigned to related commands.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DeleteDomainModelCommand(DomainModel model, IEnumerable labels, Guid correlationIdentifier)
+ : base(model, labels, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "DeleteUserEvent";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/UpdateDomainModelCommand.cs b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/UpdateDomainModelCommand.cs
new file mode 100644
index 00000000..aec749fd
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/UpdateDomainModelCommand.cs
@@ -0,0 +1,129 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.EventAuthoring;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelUpdatedEvent;
+
+namespace RapidField.SolidInstruments.Example.Domain.Commands.ModelState.User
+{
+ ///
+ /// Represents a command to update a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class UpdateDomainModelCommand : UpdateDomainModelReportableCommand
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public UpdateDomainModelCommand()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A unique identifier that is assigned to related commands.
+ ///
+ ///
+ /// is equal to .
+ ///
+ public UpdateDomainModelCommand(Guid correlationIdentifier)
+ : base(correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// is .
+ ///
+ public UpdateDomainModelCommand(DomainModel model)
+ : base(model)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// A unique identifier that is assigned to related commands.
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public UpdateDomainModelCommand(DomainModel model, Guid correlationIdentifier)
+ : base(model, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the command.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ public UpdateDomainModelCommand(DomainModel model, IEnumerable labels)
+ : base(model, labels)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The desired state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the command.
+ ///
+ ///
+ /// A unique identifier that is assigned to related commands.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public UpdateDomainModelCommand(DomainModel model, IEnumerable labels, Guid correlationIdentifier)
+ : base(model, labels, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "UpdateUserEvent";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelCreatedEvent.cs b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelCreatedEvent.cs
new file mode 100644
index 00000000..03d0038e
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelCreatedEvent.cs
@@ -0,0 +1,180 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.EventAuthoring;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+
+namespace RapidField.SolidInstruments.Example.Domain.Events.ModelState.User
+{
+ ///
+ /// Represents information about the creation of a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class DomainModelCreatedEvent : DomainModelCreatedEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DomainModelCreatedEvent()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelCreatedEvent(Guid correlationIdentifier)
+ : base(correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// is .
+ ///
+ public DomainModelCreatedEvent(DomainModel model)
+ : base(model)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelCreatedEvent(DomainModel model, Guid correlationIdentifier)
+ : base(model, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ public DomainModelCreatedEvent(DomainModel model, IEnumerable labels)
+ : base(model, labels)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelCreatedEvent(DomainModel model, IEnumerable labels, Guid correlationIdentifier)
+ : base(model, labels, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// The verbosity level of the event. The default value is
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelCreatedEvent(DomainModel model, IEnumerable labels, EventVerbosity verbosity)
+ : base(model, labels, verbosity)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// The verbosity level of the event. The default value is
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to -or-
+ /// is equal to .
+ ///
+ public DomainModelCreatedEvent(DomainModel model, IEnumerable labels, EventVerbosity verbosity, Guid correlationIdentifier)
+ : base(model, labels, verbosity, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "UserCreatedEvent";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelDeletedEvent.cs b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelDeletedEvent.cs
new file mode 100644
index 00000000..5aef3b33
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelDeletedEvent.cs
@@ -0,0 +1,180 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.EventAuthoring;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+
+namespace RapidField.SolidInstruments.Example.Domain.Events.ModelState.User
+{
+ ///
+ /// Represents information about the deletion of a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class DomainModelDeletedEvent : DomainModelDeletedEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DomainModelDeletedEvent()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelDeletedEvent(Guid correlationIdentifier)
+ : base(correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// is .
+ ///
+ public DomainModelDeletedEvent(DomainModel model)
+ : base(model)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelDeletedEvent(DomainModel model, Guid correlationIdentifier)
+ : base(model, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ public DomainModelDeletedEvent(DomainModel model, IEnumerable labels)
+ : base(model, labels)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelDeletedEvent(DomainModel model, IEnumerable labels, Guid correlationIdentifier)
+ : base(model, labels, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// The verbosity level of the event. The default value is
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelDeletedEvent(DomainModel model, IEnumerable labels, EventVerbosity verbosity)
+ : base(model, labels, verbosity)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// The verbosity level of the event. The default value is
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to -or-
+ /// is equal to .
+ ///
+ public DomainModelDeletedEvent(DomainModel model, IEnumerable labels, EventVerbosity verbosity, Guid correlationIdentifier)
+ : base(model, labels, verbosity, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "UserDeletedEvent";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelUpdatedEvent.cs b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelUpdatedEvent.cs
new file mode 100644
index 00000000..ab84c5d5
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelUpdatedEvent.cs
@@ -0,0 +1,180 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.EventAuthoring;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+
+namespace RapidField.SolidInstruments.Example.Domain.Events.ModelState.User
+{
+ ///
+ /// Represents information about an update to a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class DomainModelUpdatedEvent : DomainModelUpdatedEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DomainModelUpdatedEvent()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelUpdatedEvent(Guid correlationIdentifier)
+ : base(correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// is .
+ ///
+ public DomainModelUpdatedEvent(DomainModel model)
+ : base(model)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelUpdatedEvent(DomainModel model, Guid correlationIdentifier)
+ : base(model, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ public DomainModelUpdatedEvent(DomainModel model, IEnumerable labels)
+ : base(model, labels)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelUpdatedEvent(DomainModel model, IEnumerable labels, Guid correlationIdentifier)
+ : base(model, labels, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// The verbosity level of the event. The default value is
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to .
+ ///
+ public DomainModelUpdatedEvent(DomainModel model, IEnumerable labels, EventVerbosity verbosity)
+ : base(model, labels, verbosity)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The resulting state of the associated domain model.
+ ///
+ ///
+ /// A collection of textual labels that provide categorical and/or contextual information about the event.
+ ///
+ ///
+ /// The verbosity level of the event. The default value is
+ ///
+ ///
+ /// A unique identifier that is assigned to related events.
+ ///
+ ///
+ /// is -or- is .
+ ///
+ ///
+ /// is equal to -or-
+ /// is equal to .
+ ///
+ public DomainModelUpdatedEvent(DomainModel model, IEnumerable labels, EventVerbosity verbosity, Guid correlationIdentifier)
+ : base(model, labels, verbosity, correlationIdentifier)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "UserUpdatedEvent";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/CreateDomainModelCommandMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/CreateDomainModelCommandMessage.cs
new file mode 100644
index 00000000..8b360061
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/CreateDomainModelCommandMessage.cs
@@ -0,0 +1,53 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using System;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.User.CreateDomainModelCommand;
+using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelCreatedEvent;
+using ReportedEventMessage = RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.User.DomainModelCreatedEventMessage;
+
+namespace RapidField.SolidInstruments.Example.Domain.Messages.Command.ModelState.User
+{
+ using DomainModelCommandMessage = Messaging.CommandMessages.CreateDomainModelCommandMessage;
+
+ ///
+ /// Represents a message that contains a command to create a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class CreateDomainModelCommandMessage : DomainModelCommandMessage
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public CreateDomainModelCommandMessage()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The associated command.
+ ///
+ ///
+ /// is .
+ ///
+ public CreateDomainModelCommandMessage(DomainModelCommand commandObject)
+ : base(commandObject)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "CreateUserCommandMessage";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/DeleteDomainModelCommandMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/DeleteDomainModelCommandMessage.cs
new file mode 100644
index 00000000..bc2f3839
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/DeleteDomainModelCommandMessage.cs
@@ -0,0 +1,53 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using System;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.User.DeleteDomainModelCommand;
+using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelDeletedEvent;
+using ReportedEventMessage = RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.User.DomainModelDeletedEventMessage;
+
+namespace RapidField.SolidInstruments.Example.Domain.Messages.Command.ModelState.User
+{
+ using DomainModelCommandMessage = Messaging.CommandMessages.DeleteDomainModelCommandMessage;
+
+ ///
+ /// Represents a message that contains a command to delete a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class DeleteDomainModelCommandMessage : DomainModelCommandMessage
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DeleteDomainModelCommandMessage()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The associated command.
+ ///
+ ///
+ /// is .
+ ///
+ public DeleteDomainModelCommandMessage(DomainModelCommand commandObject)
+ : base(commandObject)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "DeleteUserCommandMessage";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/UpdateDomainModelCommandMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/UpdateDomainModelCommandMessage.cs
new file mode 100644
index 00000000..0fb32fff
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/UpdateDomainModelCommandMessage.cs
@@ -0,0 +1,53 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using System;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.User.UpdateDomainModelCommand;
+using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelUpdatedEvent;
+using ReportedEventMessage = RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.User.DomainModelUpdatedEventMessage;
+
+namespace RapidField.SolidInstruments.Example.Domain.Messages.Command.ModelState.User
+{
+ using DomainModelCommandMessage = Messaging.CommandMessages.UpdateDomainModelCommandMessage;
+
+ ///
+ /// Represents a message that contains a command to update a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class UpdateDomainModelCommandMessage : DomainModelCommandMessage
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public UpdateDomainModelCommandMessage()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The associated command.
+ ///
+ ///
+ /// is .
+ ///
+ public UpdateDomainModelCommandMessage(DomainModelCommand commandObject)
+ : base(commandObject)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "UpdateUserCommandMessage";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelCreatedEventMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelCreatedEventMessage.cs
new file mode 100644
index 00000000..4fdd5f5b
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelCreatedEventMessage.cs
@@ -0,0 +1,51 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using System;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelCreatedEvent;
+
+namespace RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.User
+{
+ using DomainModelEventMessage = Messaging.EventMessages.DomainModelCreatedEventMessage;
+
+ ///
+ /// Represents a message that provides notification about the creation of a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class DomainModelCreatedEventMessage : DomainModelEventMessage
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DomainModelCreatedEventMessage()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The associated event.
+ ///
+ ///
+ /// is .
+ ///
+ public DomainModelCreatedEventMessage(DomainModelEvent eventObject)
+ : base(eventObject)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "UserCreatedEventMessage";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelDeletedEventMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelDeletedEventMessage.cs
new file mode 100644
index 00000000..3f5c1a60
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelDeletedEventMessage.cs
@@ -0,0 +1,51 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using System;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelDeletedEvent;
+
+namespace RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.User
+{
+ using DomainModelEventMessage = Messaging.EventMessages.DomainModelDeletedEventMessage;
+
+ ///
+ /// Represents a message that provides notification about the deletion of a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class DomainModelDeletedEventMessage : DomainModelEventMessage
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DomainModelDeletedEventMessage()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The associated event.
+ ///
+ ///
+ /// is .
+ ///
+ public DomainModelDeletedEventMessage(DomainModelEvent eventObject)
+ : base(eventObject)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "UserDeletedEventMessage";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelUpdatedEventMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelUpdatedEventMessage.cs
new file mode 100644
index 00000000..0d406009
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelUpdatedEventMessage.cs
@@ -0,0 +1,51 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using System;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel;
+using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelUpdatedEvent;
+
+namespace RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.User
+{
+ using DomainModelEventMessage = Messaging.EventMessages.DomainModelUpdatedEventMessage;
+
+ ///
+ /// Represents a message that provides notification about an update to a .
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class DomainModelUpdatedEventMessage : DomainModelEventMessage
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DomainModelUpdatedEventMessage()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The associated event.
+ ///
+ ///
+ /// is .
+ ///
+ public DomainModelUpdatedEventMessage(DomainModelEvent eventObject)
+ : base(eventObject)
+ {
+ return;
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "UserUpdatedEventMessage";
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.cs
new file mode 100644
index 00000000..289ab5ef
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.cs
@@ -0,0 +1,182 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.Core;
+using RapidField.SolidInstruments.Core.ArgumentValidation;
+using RapidField.SolidInstruments.Cryptography.Secrets;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.Serialization;
+using BaseDomainModel = RapidField.SolidInstruments.Core.Domain.GlobalIdentityDomainModel;
+
+namespace RapidField.SolidInstruments.Example.Domain.Models.User
+{
+ ///
+ /// Represents a user.
+ ///
+ [DataContract(Name = DataContractName)]
+ public sealed class DomainModel : BaseDomainModel, IAggregateDomainModel
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DomainModel()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A value that uniquely identifies the domain model.
+ ///
+ [DebuggerHidden]
+ internal DomainModel(Guid identifier)
+ : base(identifier)
+ {
+ return;
+ }
+
+ ///
+ /// Gets or sets the email address of the current .
+ ///
+ ///
+ /// is empty.
+ ///
+ ///
+ /// is .
+ ///
+ [DataMember]
+ public String EmailAddress
+ {
+ get => EmailAddressValue;
+ set => EmailAddressValue = value.RejectIf().IsNullOrEmpty(nameof(EmailAddress));
+ }
+
+ ///
+ /// Gets or sets the name of the current .
+ ///
+ ///
+ /// is empty.
+ ///
+ ///
+ /// is .
+ ///
+ [DataMember]
+ public String Name
+ {
+ get => NameValue;
+ set => NameValue = value.RejectIf().IsNullOrEmpty(nameof(Name));
+ }
+
+ ///
+ /// Gets or sets the hashed password for the current .
+ ///
+ ///
+ /// is empty.
+ ///
+ ///
+ /// is .
+ ///
+ [DataMember]
+ public String PasswordHash
+ {
+ get => PasswordHashValue;
+ set => PasswordHashValue = value.RejectIf().IsNullOrEmpty(nameof(PasswordHash));
+ }
+
+ ///
+ /// Represents the name that is used when representing this type in serialization and transport contexts.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const String DataContractName = "User";
+
+ ///
+ /// Represents the email address for the current .
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ [IgnoreDataMember]
+ private String EmailAddressValue;
+
+ ///
+ /// Represents the name of the current .
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ [IgnoreDataMember]
+ private String NameValue;
+
+ ///
+ /// Represents the hashed password for the current .
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ [IgnoreDataMember]
+ private String PasswordHashValue;
+
+ ///
+ /// Contains a collection of known instances.
+ ///
+ internal static class Named
+ {
+ ///
+ /// Returns a collection of all known instances.
+ ///
+ ///
+ /// A collection of all known instances.
+ ///
+ [DebuggerHidden]
+ internal static IEnumerable All() => new DomainModel[]
+ {
+ StevenCallahan,
+ TomSmith
+ };
+
+ ///
+ /// Calculates a secure, Base64-encoded hash value for the specified password.
+ ///
+ ///
+ /// The plaintext password.
+ ///
+ ///
+ /// The resulting hash value.
+ ///
+ ///
+ /// is empty.
+ ///
+ ///
+ /// is .
+ ///
+ [DebuggerHidden]
+ private static String GetPasswordHash(String plaintextPassword)
+ {
+ using var password = Password.FromAsciiString(plaintextPassword);
+ return password.CalculateSecureHashString();
+ }
+
+ ///
+ /// Gets the Steven Callahan user.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ internal static DomainModel StevenCallahan => new DomainModel(Guid.Parse("a04fc5b0-1a67-43ff-89af-750128398d8a"))
+ {
+ EmailAddress = "steven.callahan@example.com",
+ Name = "Steven Callahan",
+ PasswordHash = GetPasswordHash("My name is Steven. 321")
+ };
+
+ ///
+ /// Gets the Tom Smith user.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ internal static DomainModel TomSmith => new DomainModel(Guid.Parse("01b7e51c-95e1-4eb1-aba6-1db0657a0fa3"))
+ {
+ EmailAddress = "tom.smith@example.com",
+ Name = "Tom Smith",
+ PasswordHash = GetPasswordHash("My name is Tom. 321")
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/IAggregateDomainModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/IAggregateDomainModel.cs
new file mode 100644
index 00000000..e84d39d8
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/IAggregateDomainModel.cs
@@ -0,0 +1,61 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.Core;
+using System;
+using IBaseDomainModel = RapidField.SolidInstruments.Core.Domain.IGlobalIdentityAggregateDomainModel;
+
+namespace RapidField.SolidInstruments.Example.Domain.Models.User
+{
+ ///
+ /// Represents a user.
+ ///
+ public interface IAggregateDomainModel : IBaseDomainModel, IValueDomainModel
+ {
+ ///
+ /// Gets or sets the email address for the current .
+ ///
+ ///
+ /// is empty.
+ ///
+ ///
+ /// is .
+ ///
+ public new String EmailAddress
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the name of the current .
+ ///
+ ///
+ /// is empty.
+ ///
+ ///
+ /// is .
+ ///
+ public new String Name
+ {
+ get;
+ set;
+ }
+
+ ///
+ /// Gets or sets the hashed password for the current .
+ ///
+ ///
+ /// is empty.
+ ///
+ ///
+ /// is .
+ ///
+ public String PasswordHash
+ {
+ get;
+ set;
+ }
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/IValueDomainModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/IValueDomainModel.cs
new file mode 100644
index 00000000..a24f6c6e
--- /dev/null
+++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/IValueDomainModel.cs
@@ -0,0 +1,31 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using System;
+using IBaseDomainModel = RapidField.SolidInstruments.Core.Domain.IGlobalIdentityValueDomainModel;
+
+namespace RapidField.SolidInstruments.Example.Domain.Models.User
+{
+ ///
+ /// Represents a user.
+ ///
+ public interface IValueDomainModel : IBaseDomainModel
+ {
+ ///
+ /// Gets the email address for the current .
+ ///
+ public String EmailAddress
+ {
+ get;
+ }
+
+ ///
+ /// Gets the name of the current .
+ ///
+ public String Name
+ {
+ get;
+ }
+ }
+}
\ No newline at end of file
diff --git a/example/RapidField.SolidInstruments.Example.Domain/README.md b/example/RapidField.SolidInstruments.Example.Domain/README.md
index 720664c8..e3674583 100644
--- a/example/RapidField.SolidInstruments.Example.Domain/README.md
+++ b/example/RapidField.SolidInstruments.Example.Domain/README.md
@@ -11,7 +11,7 @@ This document describes the purpose of the [`RapidField.SolidInstruments.Example
## Purpose
-This project houses sample domain machinery that utilizes **Solid Instruments** [data access](../../src/RapidField.SolidInstruments.DataAccess/README.md) and [messaging](../../src/RapidField.SolidInstruments.Messaging/README.md) constructs.
+This project houses a sample collection of shared domain models that utilize the **Solid Instruments** [messaging](../../src/RapidField.SolidInstruments.Messaging/README.md) constructs.
## License
diff --git a/example/RapidField.SolidInstruments.Example.Domain/RapidField.SolidInstruments.Example.Domain.csproj b/example/RapidField.SolidInstruments.Example.Domain/RapidField.SolidInstruments.Example.Domain.csproj
index 901c401e..7df486db 100644
--- a/example/RapidField.SolidInstruments.Example.Domain/RapidField.SolidInstruments.Example.Domain.csproj
+++ b/example/RapidField.SolidInstruments.Example.Domain/RapidField.SolidInstruments.Example.Domain.csproj
@@ -8,7 +8,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
RapidField
Copyright (c) RapidField LLC. All rights reserved.
Solid Instruments
- This project houses sample domain machinery that utilizes Solid Instruments data access and messaging constructs.
+ This project houses a sample collection of shared domain models that utilize the Solid Instruments messaging constructs.
$(BuildVersion)
netstandard2.1
latest
@@ -28,8 +28,8 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
-
-
+
+
\ No newline at end of file
diff --git a/src/RapidField.SolidInstruments.Collections/BinaryTreeNode.cs b/src/RapidField.SolidInstruments.Collections/BinaryTreeNode.cs
index dff7978e..d67698dd 100644
--- a/src/RapidField.SolidInstruments.Collections/BinaryTreeNode.cs
+++ b/src/RapidField.SolidInstruments.Collections/BinaryTreeNode.cs
@@ -118,7 +118,7 @@ public BinaryTreeNode(T value, BinaryTreeNode leftChild, BinaryTreeNode ri
private BinaryTreeNode(T value, BinaryTreeNode leftChild, BinaryTreeNode rightChild, Boolean rejectNullLeftChild, Boolean rejectNullRightChild)
: base(value, 2)
{
- if (leftChild is null == false)
+ if ((leftChild is null) == false)
{
if (AddChild(leftChild) == false)
{
@@ -130,7 +130,7 @@ private BinaryTreeNode(T value, BinaryTreeNode leftChild, BinaryTreeNode r
leftChild.RejectIf().IsNull(nameof(leftChild));
}
- if (rightChild is null == false)
+ if ((rightChild is null) == false)
{
if (AddChild(rightChild) == false)
{
diff --git a/src/RapidField.SolidInstruments.Collections/CircularBuffer.cs b/src/RapidField.SolidInstruments.Collections/CircularBuffer.cs
index 16540afd..6ac70ef2 100644
--- a/src/RapidField.SolidInstruments.Collections/CircularBuffer.cs
+++ b/src/RapidField.SolidInstruments.Collections/CircularBuffer.cs
@@ -58,7 +58,7 @@ public T this[Int32 index]
{
using (var controlToken = StateControl.Enter())
{
- var adjustedIndex = (ReadIndex + index);
+ var adjustedIndex = ReadIndex + index;
return (adjustedIndex < Capacity) ? ElementArray[adjustedIndex] : ElementArray[adjustedIndex - Capacity];
}
}
diff --git a/src/RapidField.SolidInstruments.Collections/Extensions/ITreeNodeExtensions.cs b/src/RapidField.SolidInstruments.Collections/Extensions/ITreeNodeExtensions.cs
index ce571db6..7c353ec5 100644
--- a/src/RapidField.SolidInstruments.Collections/Extensions/ITreeNodeExtensions.cs
+++ b/src/RapidField.SolidInstruments.Collections/Extensions/ITreeNodeExtensions.cs
@@ -249,7 +249,7 @@ public static TResult TraverseUp(this ITreeNode target, Func
public T[] ToArray(Int32 startIndex, Int32 count)
{
- var indexCeiling = (startIndex.RejectIf().IsLessThan(0, nameof(startIndex)) + count.RejectIf().IsLessThan(0, nameof(count)));
+ var indexCeiling = startIndex.RejectIf().IsLessThan(0, nameof(startIndex)) + count.RejectIf().IsLessThan(0, nameof(count));
lock (SyncRoot)
{
diff --git a/src/RapidField.SolidInstruments.Collections/ReadOnlyPinnedMemory.cs b/src/RapidField.SolidInstruments.Collections/ReadOnlyPinnedMemory.cs
index 5bf9f23a..5387910a 100644
--- a/src/RapidField.SolidInstruments.Collections/ReadOnlyPinnedMemory.cs
+++ b/src/RapidField.SolidInstruments.Collections/ReadOnlyPinnedMemory.cs
@@ -242,7 +242,7 @@ public Int32 Length
///
/// Gets the length of the memory field, in bytes.
///
- public Int32 LengthInBytes => (Length * StructureSize);
+ public Int32 LengthInBytes => Length * StructureSize;
///
/// Gets a for the current .
diff --git a/src/RapidField.SolidInstruments.Collections/TreeNode.cs b/src/RapidField.SolidInstruments.Collections/TreeNode.cs
index 59a8b1dc..b9c9e628 100644
--- a/src/RapidField.SolidInstruments.Collections/TreeNode.cs
+++ b/src/RapidField.SolidInstruments.Collections/TreeNode.cs
@@ -340,7 +340,7 @@ public IEnumerable> Children
///
/// When true, is an empty collection.
///
- public Boolean IsLeaf => (ChildrenReference.Any() == false);
+ public Boolean IsLeaf => ChildrenReference.Any() == false;
///
/// Gets a value indicating whether or not the current is a root node (a node without a parent).
@@ -348,7 +348,7 @@ public IEnumerable> Children
///
/// When true, is a null reference.
///
- public Boolean IsRoot => (ParentReference is null);
+ public Boolean IsRoot => ParentReference is null;
///
/// Gets the parent node of the current , or if the current
diff --git a/src/RapidField.SolidInstruments.Command/DomainCommand.cs b/src/RapidField.SolidInstruments.Command/DomainCommand.cs
index f9e75fe8..f6cf555c 100644
--- a/src/RapidField.SolidInstruments.Command/DomainCommand.cs
+++ b/src/RapidField.SolidInstruments.Command/DomainCommand.cs
@@ -54,7 +54,7 @@ public DomainCommand(Guid correlationIdentifier)
public DomainCommand(IEnumerable labels)
: base()
{
- Labels = new List((labels.RejectIf().IsNull(nameof(labels)).TargetArgument));
+ Labels = new List(labels.RejectIf().IsNull(nameof(labels)).TargetArgument);
}
///
@@ -75,7 +75,7 @@ public DomainCommand(IEnumerable labels)
public DomainCommand(IEnumerable labels, Guid correlationIdentifier)
: base(correlationIdentifier)
{
- Labels = new List((labels.RejectIf().IsNull(nameof(labels)).TargetArgument));
+ Labels = new List(labels.RejectIf().IsNull(nameof(labels)).TargetArgument);
}
///
@@ -138,7 +138,7 @@ public DomainCommand(Guid correlationIdentifier)
public DomainCommand(IEnumerable labels)
: base()
{
- Labels = new List((labels.RejectIf().IsNull(nameof(labels)).TargetArgument));
+ Labels = new List(labels.RejectIf().IsNull(nameof(labels)).TargetArgument);
}
///
@@ -159,7 +159,7 @@ public DomainCommand(IEnumerable labels)
public DomainCommand(IEnumerable labels, Guid correlationIdentifier)
: base(correlationIdentifier)
{
- Labels = new List((labels.RejectIf().IsNull(nameof(labels)).TargetArgument));
+ Labels = new List(labels.RejectIf().IsNull(nameof(labels)).TargetArgument);
}
///
diff --git a/src/RapidField.SolidInstruments.Command/TextualCommand.cs b/src/RapidField.SolidInstruments.Command/TextualCommand.cs
index 9623e92d..142d2740 100644
--- a/src/RapidField.SolidInstruments.Command/TextualCommand.cs
+++ b/src/RapidField.SolidInstruments.Command/TextualCommand.cs
@@ -57,7 +57,7 @@ public TextualCommand(String value)
public TextualCommand(String value, IEnumerable labels)
: base()
{
- Labels = new List((labels.RejectIf().IsNull(nameof(labels)).TargetArgument));
+ Labels = new List(labels.RejectIf().IsNull(nameof(labels)).TargetArgument);
Metadata = new Dictionary();
Value = value.RejectIf().IsNull(nameof(value));
}
diff --git a/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControl.cs b/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControl.cs
index c0c66c4d..9ed6ffa1 100644
--- a/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControl.cs
+++ b/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControl.cs
@@ -320,7 +320,7 @@ public ConcurrencyControlConsumptionState ConsumptionState
/// Represents the highest assignable token identifier.
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private const Int32 MaximumTokenIdentifier = (Int32.MaxValue - 256);
+ private const Int32 MaximumTokenIdentifier = Int32.MaxValue - 256;
///
/// Represents the maximum length of time to block a thread before raising an exception, or
diff --git a/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControlOperationException.cs b/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControlOperationException.cs
index b40611da..e1eb161e 100644
--- a/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControlOperationException.cs
+++ b/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControlOperationException.cs
@@ -56,7 +56,7 @@ public ConcurrencyControlOperationException(Exception innerException)
/// The exception that is the cause of the current exception.
///
public ConcurrencyControlOperationException(String message, Exception innerException)
- : base((message ?? ConstructMessage(innerException is null == false)), innerException)
+ : base(message ?? ConstructMessage((innerException is null) == false), innerException)
{
return;
}
diff --git a/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControlToken.cs b/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControlToken.cs
index 456f0e90..7bae48c4 100644
--- a/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControlToken.cs
+++ b/src/RapidField.SolidInstruments.Core/Concurrency/ConcurrencyControlToken.cs
@@ -70,7 +70,7 @@ internal ConcurrencyControlToken(SynchronizationContext context, Thread granteeT
///
/// A value indicating whether or not the specified instances are not equal.
///
- public static Boolean operator !=(ConcurrencyControlToken a, IConcurrencyControlToken b) => (a == b) == false;
+ public static Boolean operator !=(ConcurrencyControlToken a, IConcurrencyControlToken b) => a == b == false;
///
/// Determines whether or not a specified instance is less than another specified
@@ -85,7 +85,7 @@ internal ConcurrencyControlToken(SynchronizationContext context, Thread granteeT
///
/// if the second object is earlier than the first object, otherwise .
///
- public static Boolean operator <(ConcurrencyControlToken a, IConcurrencyControlToken b) => a.CompareTo(b) == -1;
+ public static Boolean operator <(ConcurrencyControlToken a, IConcurrencyControlToken b) => a is null ? b is Object : a.CompareTo(b) < 0;
///
/// Determines whether or not a specified instance is less than or equal to another
@@ -101,7 +101,7 @@ internal ConcurrencyControlToken(SynchronizationContext context, Thread granteeT
/// if the second object is earlier than or equal to the first object, otherwise
/// .
///
- public static Boolean operator <=(ConcurrencyControlToken a, IConcurrencyControlToken b) => a.CompareTo(b) < 1;
+ public static Boolean operator <=(ConcurrencyControlToken a, IConcurrencyControlToken b) => a is null || a.CompareTo(b) <= 0;
///
/// Determines whether or not two specified instances are equal.
@@ -142,7 +142,7 @@ internal ConcurrencyControlToken(SynchronizationContext context, Thread granteeT
///
/// if the second object is later than the first object, otherwise .
///
- public static Boolean operator >(ConcurrencyControlToken a, IConcurrencyControlToken b) => a.CompareTo(b) == 1;
+ public static Boolean operator >(ConcurrencyControlToken a, IConcurrencyControlToken b) => a is Object && a.CompareTo(b) > 0;
///
/// Determines whether or not a specified instance is greater than or equal to
@@ -158,7 +158,7 @@ internal ConcurrencyControlToken(SynchronizationContext context, Thread granteeT
/// if the second object is later than or equal to the first object, otherwise
/// .
///
- public static Boolean operator >=(ConcurrencyControlToken a, IConcurrencyControlToken b) => a.CompareTo(b) > -1;
+ public static Boolean operator >=(ConcurrencyControlToken a, IConcurrencyControlToken b) => a is null ? b is null : a.CompareTo(b) >= 0;
///
/// Instructs the current to wait for the specified task to complete before releasing
@@ -277,7 +277,7 @@ public override Boolean Equals(Object obj)
///
/// A value indicating whether or not the specified instances are equal.
///
- public Boolean Equals(IConcurrencyControlToken other) => (Identifier == other.Identifier);
+ public Boolean Equals(IConcurrencyControlToken other) => Identifier == other.Identifier;
///
/// Returns the hash code for this instance.
@@ -343,25 +343,10 @@ public Boolean Poll(Boolean raiseExceptionIfInactive, Boolean raiseExceptionIfEx
{
if (IsActive)
{
- if (IsExpired)
- {
- if (raiseExceptionIfExpired)
- {
- throw new SystemTimeoutException("The concurrency control token is expired.");
- }
-
- return false;
- }
-
- return true;
+ return IsExpired ? raiseExceptionIfExpired ? throw new SystemTimeoutException("The concurrency control token is expired.") : false : true;
}
- if (raiseExceptionIfInactive)
- {
- throw new ConcurrencyControlOperationException("Control has been relinquished to other threads.");
- }
-
- return false;
+ return raiseExceptionIfInactive ? throw new ConcurrencyControlOperationException("Control has been relinquished to other threads.") : false;
}
///
@@ -457,7 +442,7 @@ public Int32 Identifier
///
/// Gets a value indicating whether or not the associated thread currently has control of the resource.
///
- public Boolean IsActive => (IsActiveValue == IsActiveTrue);
+ public Boolean IsActive => IsActiveValue == IsActiveTrue;
///
/// Gets a value indicating whether or not the expiration threshold for the token has been exceeded.
diff --git a/src/RapidField.SolidInstruments.Core/DateTimeRange.cs b/src/RapidField.SolidInstruments.Core/DateTimeRange.cs
index 99c69808..5a1fbee1 100644
--- a/src/RapidField.SolidInstruments.Core/DateTimeRange.cs
+++ b/src/RapidField.SolidInstruments.Core/DateTimeRange.cs
@@ -92,7 +92,7 @@ public DateTimeRange(DateTime start, DateTime end, DateTimeRangeGranularity gran
///
/// A value indicating whether or not the specified instances are not equal.
///
- public static Boolean operator !=(DateTimeRange dateTimeRangeOne, DateTimeRange dateTimeRangeTwo) => (dateTimeRangeOne == dateTimeRangeTwo) == false;
+ public static Boolean operator !=(DateTimeRange dateTimeRangeOne, DateTimeRange dateTimeRangeTwo) => dateTimeRangeOne == dateTimeRangeTwo == false;
///
/// Determines whether or not two specified instances are equal.
@@ -205,7 +205,7 @@ public static Boolean TryParse(String input, out DateTimeRange result)
/// if the provided value is within the bounds of the current range, otherwise
/// .
///
- public Boolean Contains(DateTime dateTime) => (dateTime >= Start && dateTime <= End);
+ public Boolean Contains(DateTime dateTime) => dateTime >= Start && dateTime <= End;
///
/// Indicates whether or not the start and end points of the provided are within the bounds of
@@ -218,7 +218,7 @@ public static Boolean TryParse(String input, out DateTimeRange result)
/// if the provided range is within the bounds of the current range, otherwise
/// .
///
- public Boolean Contains(DateTimeRange dateTimeRange) => (dateTimeRange.Start >= Start && dateTimeRange.End <= End);
+ public Boolean Contains(DateTimeRange dateTimeRange) => dateTimeRange.Start >= Start && dateTimeRange.End <= End;
///
/// Determines whether or not the current is equal to the specified .
@@ -546,7 +546,7 @@ private void CalculateLengthInMonthsAndYears(out Int32 lengthInMonths, out Int32
{
// The last days of each calendar month are treated equally for the purpose of this calculation.
- var startAndEndPointsAreSameDayOfMonth = ((Start.IsLastDayOfMonth() && End.IsLastDayOfMonth()) || (Start.Day == End.Day));
+ var startAndEndPointsAreSameDayOfMonth = (Start.IsLastDayOfMonth() && End.IsLastDayOfMonth()) || (Start.Day == End.Day);
if (startAndEndPointsAreSameDayOfMonth)
{
@@ -591,7 +591,7 @@ private void CalculateLengthInMonthsAndYears(out Int32 lengthInMonths, out Int32
}
// Add months calculated from full years.
- lengthInMonths += (lengthInYears * 12);
+ lengthInMonths += lengthInYears * 12;
if (endPrecedesStartDuringYear)
{
@@ -713,7 +713,7 @@ private void Initialize(DateTime start, DateTime end, DateTimeRangeGranularity g
Granularity = granularity.RejectIf().IsEqualToValue(DateTimeRangeGranularity.Unspecified, nameof(granularity));
Start = start.Quantize(granularity);
End = end.Quantize(granularity);
- Length = (End - Start);
+ Length = End - Start;
LazyLengthInDays = new Lazy(CalculateLengthInDays, LazyThreadSafetyMode.PublicationOnly);
LazyLengthInHours = new Lazy(CalculateLengthInHours, LazyThreadSafetyMode.PublicationOnly);
LazyLengthInMilliseconds = new Lazy(CalculateLengthInMilliseconds, LazyThreadSafetyMode.PublicationOnly);
diff --git a/src/RapidField.SolidInstruments.Core/Extensions/BitArrayExtensions.cs b/src/RapidField.SolidInstruments.Core/Extensions/BitArrayExtensions.cs
index f53f7b9c..0bd552ac 100644
--- a/src/RapidField.SolidInstruments.Core/Extensions/BitArrayExtensions.cs
+++ b/src/RapidField.SolidInstruments.Core/Extensions/BitArrayExtensions.cs
@@ -47,7 +47,7 @@ public static BitArray PerformCircularShift(this BitArray target, BitShiftDirect
case BitShiftDirection.Left:
// Sign the shift count negative for left shifts.
- directionalBitShiftCount = (bitShiftCount.RejectIf().IsLessThan(0, nameof(bitShiftCount)) * -1);
+ directionalBitShiftCount = bitShiftCount.RejectIf().IsLessThan(0, nameof(bitShiftCount)) * -1;
break;
case BitShiftDirection.Right:
@@ -90,13 +90,13 @@ public static BitArray ReverseOrder(this BitArray target)
}
var reverseOrderBitArray = new BitArray(target);
- var fieldMidPosition = (fieldLength / 2);
+ var fieldMidPosition = fieldLength / 2;
for (var i = 0; i < fieldMidPosition; i++)
{
// Trade the current position bit for the mirror position bit.
var currentPositionBit = reverseOrderBitArray[i];
- var mirrorPosition = (fieldLength - i - 1);
+ var mirrorPosition = fieldLength - i - 1;
reverseOrderBitArray[i] = reverseOrderBitArray[mirrorPosition];
reverseOrderBitArray[mirrorPosition] = currentPositionBit;
}
@@ -150,18 +150,18 @@ public static String ToBinaryString(this BitArray target)
private static Int32 DetermineNewCircularPosition(Int32 currentPosition, Int32 arrayLength, Int32 directionalShift)
{
// Perform an open-ended (non-circular) shift.
- var newPosition = (currentPosition + directionalShift);
+ var newPosition = currentPosition + directionalShift;
while (newPosition < 0)
{
// Rotate the field right to bring the new position back into frame.
- newPosition = (newPosition + arrayLength);
+ newPosition += arrayLength;
}
while (newPosition >= arrayLength)
{
// Rotate the field left to bring the new position back into frame.
- newPosition = (newPosition - arrayLength);
+ newPosition -= arrayLength;
}
return newPosition;
diff --git a/src/RapidField.SolidInstruments.Core/Extensions/ByteCollectionExtensions.cs b/src/RapidField.SolidInstruments.Core/Extensions/ByteCollectionExtensions.cs
index 7e4f5d2e..1b3a74df 100644
--- a/src/RapidField.SolidInstruments.Core/Extensions/ByteCollectionExtensions.cs
+++ b/src/RapidField.SolidInstruments.Core/Extensions/ByteCollectionExtensions.cs
@@ -131,16 +131,16 @@ public static Byte[] PerformCircularBitShift(this Byte[] target, BitShiftDirecti
}
var collectionByteLength = target.Length;
- var collectionBitLength = (collectionByteLength * 8);
- var simplifiedBitShiftCount = (bitShiftCount.RejectIf().IsLessThan(0, nameof(bitShiftCount)) % collectionBitLength);
+ var collectionBitLength = collectionByteLength * 8;
+ var simplifiedBitShiftCount = bitShiftCount.RejectIf().IsLessThan(0, nameof(bitShiftCount)) % collectionBitLength;
if (simplifiedBitShiftCount == 0)
{
return target;
}
- var simplifiedByteShiftCount = (simplifiedBitShiftCount / 8);
- var bitShiftRemainder = (simplifiedBitShiftCount % 8);
+ var simplifiedByteShiftCount = simplifiedBitShiftCount / 8;
+ var bitShiftRemainder = simplifiedBitShiftCount % 8;
var outputBuffer = new Byte[collectionByteLength];
Int32 headIndex;
Int32 readIndex;
@@ -173,14 +173,14 @@ public static Byte[] PerformCircularBitShift(this Byte[] target, BitShiftDirecti
{
leftElement = target[readIndex];
rightElement = target[readIndex == (collectionByteLength - 1) ? 0 : (readIndex + 1)];
- outputBuffer[writeIndex] = unchecked((Byte)(leftElement >> bitShiftRemainder | rightElement << (8 - bitShiftRemainder)));
+ outputBuffer[writeIndex] = unchecked((Byte)((leftElement >> bitShiftRemainder) | (rightElement << (8 - bitShiftRemainder))));
}
for (readIndex = 0; readIndex < headIndex; readIndex++, writeIndex++)
{
leftElement = target[readIndex];
rightElement = target[readIndex + 1];
- outputBuffer[writeIndex] = unchecked((Byte)(leftElement >> bitShiftRemainder | rightElement << (8 - bitShiftRemainder)));
+ outputBuffer[writeIndex] = unchecked((Byte)((leftElement >> bitShiftRemainder) | (rightElement << (8 - bitShiftRemainder))));
}
}
@@ -188,7 +188,7 @@ public static Byte[] PerformCircularBitShift(this Byte[] target, BitShiftDirecti
case BitShiftDirection.Right:
- headIndex = (collectionByteLength - simplifiedByteShiftCount);
+ headIndex = collectionByteLength - simplifiedByteShiftCount;
if (bitShiftRemainder == 0)
{
@@ -211,14 +211,14 @@ public static Byte[] PerformCircularBitShift(this Byte[] target, BitShiftDirecti
{
leftElement = target[readIndex - 1];
rightElement = target[readIndex];
- outputBuffer[writeIndex] = unchecked((Byte)(leftElement >> (8 - bitShiftRemainder) | rightElement << bitShiftRemainder));
+ outputBuffer[writeIndex] = unchecked((Byte)((leftElement >> (8 - bitShiftRemainder)) | (rightElement << bitShiftRemainder)));
}
for (readIndex = 0; readIndex < headIndex; readIndex++, writeIndex++)
{
leftElement = target[readIndex == 0 ? (collectionByteLength - 1) : (readIndex - 1)];
rightElement = target[readIndex];
- outputBuffer[writeIndex] = unchecked((Byte)(leftElement >> (8 - bitShiftRemainder) | rightElement << bitShiftRemainder));
+ outputBuffer[writeIndex] = unchecked((Byte)((leftElement >> (8 - bitShiftRemainder)) | (rightElement << bitShiftRemainder)));
}
}
diff --git a/src/RapidField.SolidInstruments.Core/Extensions/DateTimeExtensions.cs b/src/RapidField.SolidInstruments.Core/Extensions/DateTimeExtensions.cs
index ee35807e..75819e0b 100644
--- a/src/RapidField.SolidInstruments.Core/Extensions/DateTimeExtensions.cs
+++ b/src/RapidField.SolidInstruments.Core/Extensions/DateTimeExtensions.cs
@@ -455,7 +455,7 @@ internal static Boolean TryParseExtendedFormatDateTimeString(String dateTimeStri
return true;
}
- return DateTime.TryParse(dateTimeString, formatProvider, (DateTimeStyles.AllowWhiteSpaces | DateTimeStyles.RoundtripKind), out result);
+ return DateTime.TryParse(dateTimeString, formatProvider, DateTimeStyles.AllowWhiteSpaces | DateTimeStyles.RoundtripKind, out result);
}
///
@@ -498,7 +498,7 @@ internal static Boolean TryParseExtendedFormatDateTimeString(String dateTimeStri
internal static Boolean TryParseFullDetailDateTimeString(String dateTimeString, IFormatProvider formatProvider, out DateTime result)
{
var dateTimeStringFormat = dateTimeString.Contains(DateTimeZoneUtcFormat) ? FullDetailDateTimeFormatTemplate.ApplyFormat(DateTimeZoneUtcFormat) : FullDetailDateTimeFormatTemplate.ApplyFormat(DateTimeZoneLocalFormat);
- return DateTime.TryParseExact(dateTimeString, dateTimeStringFormat, formatProvider, (DateTimeStyles.AllowWhiteSpaces | DateTimeStyles.RoundtripKind), out result);
+ return DateTime.TryParseExact(dateTimeString, dateTimeStringFormat, formatProvider, DateTimeStyles.AllowWhiteSpaces | DateTimeStyles.RoundtripKind, out result);
}
///
@@ -538,7 +538,7 @@ internal static Boolean TryParseFullDetailDateTimeString(String dateTimeString,
/// .
///
[DebuggerHidden]
- internal static Boolean TryParseSerializedDateTimeString(String dateTimeString, IFormatProvider formatProvider, out DateTime result) => DateTime.TryParseExact(dateTimeString, SerializedDateTimeFormat, formatProvider, (DateTimeStyles.AllowWhiteSpaces | DateTimeStyles.RoundtripKind), out result);
+ internal static Boolean TryParseSerializedDateTimeString(String dateTimeString, IFormatProvider formatProvider, out DateTime result) => DateTime.TryParseExact(dateTimeString, SerializedDateTimeFormat, formatProvider, DateTimeStyles.AllowWhiteSpaces | DateTimeStyles.RoundtripKind, out result);
///
/// Constructs and returns a detailed format string using the time zone kind of the provided .
diff --git a/src/RapidField.SolidInstruments.Core/Extensions/IEnumerableExtensions.cs b/src/RapidField.SolidInstruments.Core/Extensions/IEnumerableExtensions.cs
index fd5adc43..a360343c 100644
--- a/src/RapidField.SolidInstruments.Core/Extensions/IEnumerableExtensions.cs
+++ b/src/RapidField.SolidInstruments.Core/Extensions/IEnumerableExtensions.cs
@@ -84,6 +84,6 @@ public static Boolean IsEquivalentTo(this IEnumerable target, IEnumerable<
/// if the current is or empty, otherwise
/// .
///
- public static Boolean IsNullOrEmpty(this IEnumerable target) => (target is null || target.Count() == 0);
+ public static Boolean IsNullOrEmpty(this IEnumerable target) => target is null || target.Count() == 0;
}
}
\ No newline at end of file
diff --git a/src/RapidField.SolidInstruments.Core/Extensions/StringExtensions.cs b/src/RapidField.SolidInstruments.Core/Extensions/StringExtensions.cs
index c479cc29..f43affdd 100644
--- a/src/RapidField.SolidInstruments.Core/Extensions/StringExtensions.cs
+++ b/src/RapidField.SolidInstruments.Core/Extensions/StringExtensions.cs
@@ -92,7 +92,7 @@ public static class StringExtensions
/// if the current is or empty, otherwise
/// .
///
- public static Boolean IsNullOrEmpty(this String target) => (target is null || target.Length == 0);
+ public static Boolean IsNullOrEmpty(this String target) => target is null || target.Length == 0;
///
/// Indicates whether or not the current is , empty or consists only of
@@ -105,7 +105,7 @@ public static class StringExtensions
/// if the current is or empty, otherwise
/// .
///
- public static Boolean IsNullOrWhiteSpace(this String target) => (String.IsNullOrWhiteSpace(target));
+ public static Boolean IsNullOrWhiteSpace(this String target) => String.IsNullOrWhiteSpace(target);
///
/// Indicates whether or not the specified regular expression pattern finds a match in the current .
diff --git a/src/RapidField.SolidInstruments.Core/Extensions/UriExtensions.cs b/src/RapidField.SolidInstruments.Core/Extensions/UriExtensions.cs
index 34e5ce45..c954887e 100644
--- a/src/RapidField.SolidInstruments.Core/Extensions/UriExtensions.cs
+++ b/src/RapidField.SolidInstruments.Core/Extensions/UriExtensions.cs
@@ -85,7 +85,7 @@ public static Uri AppendQueryStringData(this Uri target, IDictionary has been disposed or is currently in the
/// process of being disposed.
///
- protected Boolean IsDisposedOrDisposing => (IsDisposed || IsDisposing);
+ protected Boolean IsDisposedOrDisposing => IsDisposed || IsDisposing;
///
/// Gets a value indicating whether or not the current is currently in the process of being
diff --git a/src/RapidField.SolidInstruments.Core/Model.cs b/src/RapidField.SolidInstruments.Core/Model.cs
index 675bdec5..e1f387d9 100644
--- a/src/RapidField.SolidInstruments.Core/Model.cs
+++ b/src/RapidField.SolidInstruments.Core/Model.cs
@@ -55,7 +55,7 @@ protected Model(TIdentifier identifier)
///
/// A value indicating whether or not the specified instances are not equal.
///
- public static Boolean operator !=(Model a, IModel b) => (a == b) == false;
+ public static Boolean operator !=(Model a, IModel b) => a == b == false;
///
/// Determines whether or not a specified instance is less than another specified
@@ -70,7 +70,7 @@ protected Model(TIdentifier identifier)
///
/// if the second object is earlier than the first object, otherwise .
///
- public static Boolean operator <(Model a, IModel b) => a.CompareTo(b) == -1;
+ public static Boolean operator <(Model a, IModel b) => a is null ? b is Object : a.CompareTo(b) < 0;
///
/// Determines whether or not a specified instance is less than or equal to another
@@ -86,7 +86,7 @@ protected Model(TIdentifier identifier)
/// if the second object is earlier than or equal to the first object, otherwise
/// .
///
- public static Boolean operator <=(Model a, IModel b) => a.CompareTo(b) < 1;
+ public static Boolean operator <=(Model a, IModel b) => a is null || a.CompareTo(b) <= 0;
///
/// Determines whether or not two specified instances are equal.
@@ -102,11 +102,11 @@ protected Model(TIdentifier identifier)
///
public static Boolean operator ==(Model a, IModel b)
{
- if ((Object)a is null && (Object)b is null)
+ if (a is null && b is null)
{
return true;
}
- else if ((Object)a is null || (Object)b is null)
+ else if (a is null || b is null)
{
return false;
}
@@ -127,7 +127,7 @@ protected Model(TIdentifier identifier)
///
/// if the second object is later than the first object, otherwise .
///
- public static Boolean operator >(Model a, IModel b) => a.CompareTo(b) == 1;
+ public static Boolean operator >(Model a, IModel b) => a is Object && a.CompareTo(b) > 0;
///
/// Determines whether or not a specified instance is greater than or equal to another
@@ -143,7 +143,7 @@ protected Model(TIdentifier identifier)
/// if the second object is later than or equal to the first object, otherwise
/// .
///
- public static Boolean operator >=(Model a, IModel b) => a.CompareTo(b) > -1;
+ public static Boolean operator >=(Model a, IModel b) => a is null ? b is null : a.CompareTo(b) >= 0;
///
/// Compares the current to the specified object and returns an indication of their
@@ -225,7 +225,7 @@ protected Model()
///
/// A value indicating whether or not the specified instances are not equal.
///
- public static Boolean operator !=(Model a, IModel b) => (a == b) == false;
+ public static Boolean operator !=(Model a, IModel b) => a == b == false;
///
/// Determines whether or not two specified instances are equal.
@@ -241,11 +241,11 @@ protected Model()
///
public static Boolean operator ==(Model a, IModel b)
{
- if ((Object)a is null && (Object)b is null)
+ if (a is null && b is null)
{
return true;
}
- else if ((Object)a is null || (Object)b is null)
+ else if (a is null || b is null)
{
return false;
}
diff --git a/src/RapidField.SolidInstruments.Core/Nix.cs b/src/RapidField.SolidInstruments.Core/Nix.cs
index 79103e8f..8847f2de 100644
--- a/src/RapidField.SolidInstruments.Core/Nix.cs
+++ b/src/RapidField.SolidInstruments.Core/Nix.cs
@@ -43,7 +43,7 @@ private Nix(Byte value)
///
/// A value indicating whether or not the specified instances are not equal.
///
- public static Boolean operator !=(Nix a, Nix b) => (a == b) == false;
+ public static Boolean operator !=(Nix a, Nix b) => a == b == false;
///
/// Determines whether or not a specified instance is less than another specified instance.
@@ -147,7 +147,7 @@ private Nix(Byte value)
/// Negative one if this instance is earlier than the specified instance; one if this instance is later than the supplied
/// instance; zero if they are equal.
///
- public Int32 CompareTo(Object obj) => obj is Nix ? CompareTo((Nix)obj) : GetType().FullName.CompareTo(obj.GetType().FullName);
+ public Int32 CompareTo(Object obj) => obj is Nix nix ? CompareTo(nix) : GetType().FullName.CompareTo(obj.GetType().FullName);
///
/// Determines whether or not the current is equal to the specified .
diff --git a/src/RapidField.SolidInstruments.Core/ReferenceManager.cs b/src/RapidField.SolidInstruments.Core/ReferenceManager.cs
index 6645100d..56ab6ddc 100644
--- a/src/RapidField.SolidInstruments.Core/ReferenceManager.cs
+++ b/src/RapidField.SolidInstruments.Core/ReferenceManager.cs
@@ -90,7 +90,7 @@ protected override void Dispose(Boolean disposing)
disposeTasks.Add(reference?.DisposeAsync().AsTask());
}
- var disposeTaskArray = disposeTasks.Where(task => task is null == false).ToArray();
+ var disposeTaskArray = disposeTasks.Where(task => (task is null) == false).ToArray();
if (disposeTaskArray.Any())
{
@@ -153,7 +153,7 @@ internal ManagedReference(T target)
///
/// A value indicating whether or not the specified instances are not equal.
///
- public static Boolean operator !=(ManagedReference a, ManagedReference b) => (a == b) == false;
+ public static Boolean operator !=(ManagedReference a, ManagedReference b) => a == b == false;
///
/// Determines whether or not two specified instances are equal.
diff --git a/src/RapidField.SolidInstruments.Core/SemanticVersion.cs b/src/RapidField.SolidInstruments.Core/SemanticVersion.cs
index cff3e9c1..46972c50 100644
--- a/src/RapidField.SolidInstruments.Core/SemanticVersion.cs
+++ b/src/RapidField.SolidInstruments.Core/SemanticVersion.cs
@@ -199,7 +199,7 @@ public static SemanticVersion OfAssembly(Assembly assembly)
///
/// A value indicating whether or not the specified instances are not equal.
///
- public static Boolean operator !=(SemanticVersion a, ISemanticVersion b) => (a == b) == false;
+ public static Boolean operator !=(SemanticVersion a, ISemanticVersion b) => a == b == false;
///
/// Determines whether or not a specified instance is less than another specified instance.
@@ -213,7 +213,7 @@ public static SemanticVersion OfAssembly(Assembly assembly)
///
/// if the second object is earlier than the first object, otherwise .
///
- public static Boolean operator <(SemanticVersion a, ISemanticVersion b) => a.CompareTo(b) == -1;
+ public static Boolean operator <(SemanticVersion a, ISemanticVersion b) => a is null ? b is Object : a.CompareTo(b) < 0;
///
/// Determines whether or not a specified instance is less than or equal to another supplied
@@ -229,7 +229,7 @@ public static SemanticVersion OfAssembly(Assembly assembly)
/// if the second object is earlier than or equal to the first object, otherwise
/// .
///
- public static Boolean operator <=(SemanticVersion a, ISemanticVersion b) => a.CompareTo(b) < 1;
+ public static Boolean operator <=(SemanticVersion a, ISemanticVersion b) => a is null || a.CompareTo(b) <= 0;
///
/// Determines whether or not two specified instances are equal.
@@ -245,11 +245,11 @@ public static SemanticVersion OfAssembly(Assembly assembly)
///
public static Boolean operator ==(SemanticVersion a, ISemanticVersion b)
{
- if ((Object)a is null && (Object)b is null)
+ if (a is null && b is null)
{
return true;
}
- else if ((Object)a is null || (Object)b is null)
+ else if (a is null || b is null)
{
return false;
}
@@ -270,7 +270,7 @@ public static SemanticVersion OfAssembly(Assembly assembly)
///
/// if the second object is later than the first object, otherwise .
///
- public static Boolean operator >(SemanticVersion a, ISemanticVersion b) => a.CompareTo(b) == 1;
+ public static Boolean operator >(SemanticVersion a, ISemanticVersion b) => a is Object && a.CompareTo(b) > 0;
///
/// Determines whether or not a specified instance is greater than or equal to another
@@ -286,7 +286,7 @@ public static SemanticVersion OfAssembly(Assembly assembly)
/// if the second object is later than or equal to the first object, otherwise
/// .
///
- public static Boolean operator >=(SemanticVersion a, ISemanticVersion b) => a.CompareTo(b) > -1;
+ public static Boolean operator >=(SemanticVersion a, ISemanticVersion b) => a is null ? b is null : a.CompareTo(b) >= 0;
///
/// Converts the specified representation of a semantic version to its
@@ -307,15 +307,7 @@ public static SemanticVersion OfAssembly(Assembly assembly)
///
/// does not contain a valid representation of a semantic version.
///
- public static SemanticVersion Parse(String input)
- {
- if (Parse(input, out var value, true))
- {
- return value;
- }
-
- return default;
- }
+ public static SemanticVersion Parse(String input) => Parse(input, out var value, true) ? value : default;
///
/// Converts the specified representation of a semantic version to its
@@ -521,7 +513,7 @@ public override Int32 GetHashCode()
///
/// is invalid -or- is invalid.
///
- public SemanticVersion NextMajorVersion(String preReleaseLabel, String buildMetadata) => new SemanticVersion((MajorVersion + 1), 0, 0, preReleaseLabel, buildMetadata);
+ public SemanticVersion NextMajorVersion(String preReleaseLabel, String buildMetadata) => new SemanticVersion(MajorVersion + 1, 0, 0, preReleaseLabel, buildMetadata);
///
/// Returns the next minor version after the current .
@@ -561,7 +553,7 @@ public override Int32 GetHashCode()
///
/// is invalid -or- is invalid.
///
- public SemanticVersion NextMinorVersion(String preReleaseLabel, String buildMetadata) => new SemanticVersion(MajorVersion, (MinorVersion + 1), 0, preReleaseLabel, buildMetadata);
+ public SemanticVersion NextMinorVersion(String preReleaseLabel, String buildMetadata) => new SemanticVersion(MajorVersion, MinorVersion + 1, 0, preReleaseLabel, buildMetadata);
///
/// Returns the next patch version after the current .
@@ -601,7 +593,7 @@ public override Int32 GetHashCode()
///
/// is invalid -or- is invalid.
///
- public SemanticVersion NextPatchVersion(String preReleaseLabel, String buildMetadata) => new SemanticVersion(MajorVersion, MinorVersion, (PatchVersion + 1), preReleaseLabel, buildMetadata);
+ public SemanticVersion NextPatchVersion(String preReleaseLabel, String buildMetadata) => new SemanticVersion(MajorVersion, MinorVersion, PatchVersion + 1, preReleaseLabel, buildMetadata);
///
/// Converts the value of the current to its equivalent string representation.
@@ -616,12 +608,12 @@ public override String ToString()
if (PreReleaseLabel.IsNullOrEmpty() == false)
{
- stringBuilder.Append($"{DelimiterPrefixForPreReleaseLabel}{PreReleaseLabel}");
+ _ = stringBuilder.Append($"{DelimiterPrefixForPreReleaseLabel}{PreReleaseLabel}");
}
if (BuildMetadata.IsNullOrEmpty() == false)
{
- stringBuilder.Append($"{DelimiterPrefixForBuildMetadata}{BuildMetadata}");
+ _ = stringBuilder.Append($"{DelimiterPrefixForBuildMetadata}{BuildMetadata}");
}
return stringBuilder.ToString();
@@ -839,21 +831,21 @@ public String BuildMetadata
/// x.0.0).
///
[IgnoreDataMember]
- public Boolean IsMajor => (MinorVersion == 0 && PatchVersion == 0);
+ public Boolean IsMajor => MinorVersion == 0 && PatchVersion == 0;
///
/// Gets a value indicating whether or not the current represents a new minor version (eg.
/// x.x.0).
///
[IgnoreDataMember]
- public Boolean IsMinor => (MinorVersion > 0 && PatchVersion == 0);
+ public Boolean IsMinor => MinorVersion > 0 && PatchVersion == 0;
///
/// Gets a value indicating whether or not the current represents a patch version (
/// is greater than zero).
///
[IgnoreDataMember]
- public Boolean IsPatch => (PatchVersion > 0);
+ public Boolean IsPatch => PatchVersion > 0;
///
/// Gets a value indicating whether or not the current represents a pre-release version.
@@ -865,7 +857,7 @@ public String BuildMetadata
/// Gets a value indicating whether or not the current represents a stable version.
///
[IgnoreDataMember]
- public Boolean IsStable => (IsPreRelease == false);
+ public Boolean IsStable => IsPreRelease == false;
///
/// Gets or sets the major version number, which is incremented for compatibility-breaking feature changes.
diff --git a/src/RapidField.SolidInstruments.Core/TimeOfDay.cs b/src/RapidField.SolidInstruments.Core/TimeOfDay.cs
index f065268e..4e451b47 100644
--- a/src/RapidField.SolidInstruments.Core/TimeOfDay.cs
+++ b/src/RapidField.SolidInstruments.Core/TimeOfDay.cs
@@ -135,7 +135,7 @@ public TimeOfDay(TimeZoneInfo zone, Int32 hour, Int32 minute, Int32 second, Int3
///
/// A value indicating whether or not the specified instances are not equal.
///
- public static Boolean operator !=(TimeOfDay a, TimeOfDay b) => (a == b) == false;
+ public static Boolean operator !=(TimeOfDay a, TimeOfDay b) => a == b == false;
///
/// Determines whether or not a specified instance is less than another specified instance.
@@ -149,7 +149,7 @@ public TimeOfDay(TimeZoneInfo zone, Int32 hour, Int32 minute, Int32 second, Int3
///
/// if the second object is earlier than the first object, otherwise .
///
- public static Boolean operator <(TimeOfDay a, TimeOfDay b) => a.CompareTo(b) == -1;
+ public static Boolean operator <(TimeOfDay a, TimeOfDay b) => a is null ? b is Object : a.CompareTo(b) < 0;
///
/// Determines whether or not a specified instance is less than or equal to another supplied
@@ -165,7 +165,7 @@ public TimeOfDay(TimeZoneInfo zone, Int32 hour, Int32 minute, Int32 second, Int3
/// if the second object is earlier than or equal to the first object, otherwise
/// .
///
- public static Boolean operator <=(TimeOfDay a, TimeOfDay b) => a.CompareTo(b) < 1;
+ public static Boolean operator <=(TimeOfDay a, TimeOfDay b) => a is null || a.CompareTo(b) <= 0;
///
/// Determines whether or not two specified instances are equal.
@@ -181,11 +181,11 @@ public TimeOfDay(TimeZoneInfo zone, Int32 hour, Int32 minute, Int32 second, Int3
///
public static Boolean operator ==(TimeOfDay a, TimeOfDay b)
{
- if ((Object)a is null && (Object)b is null)
+ if (a is null && b is null)
{
return true;
}
- else if ((Object)a is null || (Object)b is null)
+ else if (a is null || b is null)
{
return false;
}
@@ -205,7 +205,7 @@ public TimeOfDay(TimeZoneInfo zone, Int32 hour, Int32 minute, Int32 second, Int3
///
/// if the second object is later than the first object, otherwise .
///
- public static Boolean operator >(TimeOfDay a, TimeOfDay b) => a.CompareTo(b) == 1;
+ public static Boolean operator >(TimeOfDay a, TimeOfDay b) => a is Object && a.CompareTo(b) > 0;
///
/// Determines whether or not a specified instance is greater than or equal to another supplied
@@ -221,7 +221,7 @@ public TimeOfDay(TimeZoneInfo zone, Int32 hour, Int32 minute, Int32 second, Int3
/// if the second object is later than or equal to the first object, otherwise
/// .
///
- public static Boolean operator >=(TimeOfDay a, TimeOfDay b) => a.CompareTo(b) > -1;
+ public static Boolean operator >=(TimeOfDay a, TimeOfDay b) => a is null ? b is null : a.CompareTo(b) >= 0;
///
/// Converts the specified representation of a time of day value to its
@@ -245,15 +245,7 @@ public TimeOfDay(TimeZoneInfo zone, Int32 hour, Int32 minute, Int32 second, Int3
///
/// does not contain a valid representation of a time of day value.
///
- public static TimeOfDay Parse(String input)
- {
- if (Parse(input, out var zone, out var hour, out var minute, out var second, out var millisecond, true))
- {
- return new TimeOfDay(zone, hour, minute, second, millisecond);
- }
-
- return null;
- }
+ public static TimeOfDay Parse(String input) => Parse(input, out var zone, out var hour, out var minute, out var second, out var millisecond, true) ? new TimeOfDay(zone, hour, minute, second, millisecond) : null;
///
/// Converts the specified representation of a time of day value to its
@@ -347,19 +339,7 @@ public Int32 CompareTo(TimeOfDay other)
{
var thisInstanceCountOfMillisecondsPastMidnightUtc = CountOfMillisecondsPastMidnightUtc();
var otherInstanceCountOfMillisecondsPastMidnightUtc = other.CountOfMillisecondsPastMidnightUtc();
-
- if (thisInstanceCountOfMillisecondsPastMidnightUtc < otherInstanceCountOfMillisecondsPastMidnightUtc)
- {
- return -1;
- }
- else if (thisInstanceCountOfMillisecondsPastMidnightUtc > otherInstanceCountOfMillisecondsPastMidnightUtc)
- {
- return 1;
- }
- else
- {
- return 0;
- }
+ return thisInstanceCountOfMillisecondsPastMidnightUtc < otherInstanceCountOfMillisecondsPastMidnightUtc ? -1 : thisInstanceCountOfMillisecondsPastMidnightUtc > otherInstanceCountOfMillisecondsPastMidnightUtc ? 1 : 0;
}
///
@@ -851,7 +831,7 @@ private static Boolean Parse(String input, out TimeZoneInfo zone, out Int32 hour
hour += 12;
}
- var zoneStringFragmentCount = (rawValueSubstrings.Length - 2);
+ var zoneStringFragmentCount = rawValueSubstrings.Length - 2;
var zoneStringFragment = zoneStringFragmentCount == 1 ? rawValueSubstrings[2] : String.Join(" ", rawValueSubstrings.Skip(2).Take(zoneStringFragmentCount).ToArray(), 0, zoneStringFragmentCount);
if (raiseExceptionOnFail)
@@ -893,7 +873,7 @@ private static Boolean Parse(String input, out TimeZoneInfo zone, out Int32 hour
/// The number of milliseconds past midnight in the local timezone that the current instance represents.
///
[DebuggerHidden]
- private Int32 CountOfMillisecondsPastMidnightLocal() => ((Convert.ToInt32(Hour) * 3600000) + (Convert.ToInt32(Minute) * 60000) + (Convert.ToInt32(Second) * 1000) + Convert.ToInt32(Millisecond));
+ private Int32 CountOfMillisecondsPastMidnightLocal() => (Convert.ToInt32(Hour) * 3600000) + (Convert.ToInt32(Minute) * 60000) + (Convert.ToInt32(Second) * 1000) + Convert.ToInt32(Millisecond);
///
/// Counts how many milliseconds past midnight in Coordinated Universal Time (UTC) the current
@@ -903,7 +883,7 @@ private static Boolean Parse(String input, out TimeZoneInfo zone, out Int32 hour
/// The number of milliseconds past midnight UTC that the current instance represents.
///
[DebuggerHidden]
- private Int32 CountOfMillisecondsPastMidnightUtc() => (CountOfMillisecondsPastMidnightLocal() + (Zone.BaseUtcOffset.Hours * 3600000));
+ private Int32 CountOfMillisecondsPastMidnightUtc() => CountOfMillisecondsPastMidnightLocal() + (Zone.BaseUtcOffset.Hours * 3600000);
///
/// Initializes or reinitializes the instance using the specified serialized representation.
@@ -923,7 +903,7 @@ private static Boolean Parse(String input, out TimeZoneInfo zone, out Int32 hour
[DebuggerHidden]
private void Initialize(String input)
{
- Parse(input, out var zone, out var hour, out var minute, out var second, out var millisecond, true);
+ _ = Parse(input, out var zone, out var hour, out var minute, out var second, out var millisecond, true);
Zone = zone;
Hour = hour;
Minute = minute;
diff --git a/src/RapidField.SolidInstruments.Cryptography/CryptographicKey.cs b/src/RapidField.SolidInstruments.Cryptography/CryptographicKey.cs
index 397f8641..2bb5afbd 100644
--- a/src/RapidField.SolidInstruments.Cryptography/CryptographicKey.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/CryptographicKey.cs
@@ -69,9 +69,9 @@ protected CryptographicKey(TAlgorithm algorithm, CryptographicKeyDerivationMode
LazyPbkdf2Provider = new Lazy(InitializePbkdf2Algorithm, LazyThreadSafetyMode.ExecutionAndPublication);
// Gather information about the derived key.
- DerivedKeyLength = (derivedKeyLengthInBits.RejectIf().IsLessThanOrEqualTo(0, nameof(derivedKeyLengthInBits)).TargetArgument / 8);
- BlockWordCount = (derivedKeyLengthInBits / 32);
- BlockCount = (KeySourceWordCount / BlockWordCount);
+ DerivedKeyLength = derivedKeyLengthInBits.RejectIf().IsLessThanOrEqualTo(0, nameof(derivedKeyLengthInBits)).TargetArgument / 8;
+ BlockWordCount = derivedKeyLengthInBits / 32;
+ BlockCount = KeySourceWordCount / BlockWordCount;
// Copy in the key source bits.
KeySource.Access(memory => Array.Copy(keySource.RejectIf().IsNull(nameof(keySource)).OrIf(argument => argument.Length > KeySourceLengthInBytes, nameof(keySource), "The specified key source contains too many elements.").TargetArgument, memory, keySource.Length));
@@ -144,7 +144,7 @@ public ISecureMemory ToDerivedKeyBytes()
for (var j = 0; j < BlockWordCount; j++)
{
// Perform the XOR layering operation.
- transformedWords[j] = (transformedWords[j] ^ sourceWords[(i * BlockWordCount) + j]);
+ transformedWords[j] = transformedWords[j] ^ sourceWords[(i * BlockWordCount) + j];
}
}
@@ -157,7 +157,7 @@ public ISecureMemory ToDerivedKeyBytes()
for (var j = 0; j < BlockWordCount; j++)
{
// Perform the XOR layering operation with substitution.
- transformedWords[j] = (SubstituteWord(transformedWords[j]) ^ sourceWords[(i * BlockWordCount) + j]);
+ transformedWords[j] = SubstituteWord(transformedWords[j]) ^ sourceWords[(i * BlockWordCount) + j];
}
}
@@ -356,7 +356,7 @@ public TAlgorithm Algorithm
/// Represents the byte index of the algorithm byte within an unencrypted, serialized bit field.
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- internal const Int32 AlgorithmSecureMemoryIndex = (KeySourceSecureMemoryIndex + KeySourceLengthInBytes);
+ internal const Int32 AlgorithmSecureMemoryIndex = KeySourceSecureMemoryIndex + KeySourceLengthInBytes;
///
/// Represents the default derivation mode for new keys.
@@ -368,13 +368,13 @@ public TAlgorithm Algorithm
/// Represents the byte index of the derivation mode byte within an unencrypted, serialized bit field.
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- internal const Int32 DerivationModeSecureMemoryIndex = (AlgorithmSecureMemoryIndex + AlgorithmLength);
+ internal const Int32 DerivationModeSecureMemoryIndex = AlgorithmSecureMemoryIndex + AlgorithmLength;
///
/// Represents the number of bytes comprising .
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- internal const Int32 KeySourceLengthInBytes = (KeySourceWordCount * sizeof(UInt32));
+ internal const Int32 KeySourceLengthInBytes = KeySourceWordCount * sizeof(UInt32);
///
/// Represents the byte index of the key source within an unencrypted, serialized bit field.
@@ -387,14 +387,14 @@ public TAlgorithm Algorithm
/// .
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- internal const Int32 SerializedLength = (SerializedPlaintextLength + (SecureMemoryEncryptionAlgorithmBlockSizeInBytes * 2) - AlgorithmLength - DerivationModeLength);
+ internal const Int32 SerializedLength = SerializedPlaintextLength + (SecureMemoryEncryptionAlgorithmBlockSizeInBytes * 2) - AlgorithmLength - DerivationModeLength;
///
/// Represents the number of bytes comprising a pre-encrypted, serialized representation of a
/// .
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- internal const Int32 SerializedPlaintextLength = (KeySourceLengthInBytes + AlgorithmLength + DerivationModeLength);
+ internal const Int32 SerializedPlaintextLength = KeySourceLengthInBytes + AlgorithmLength + DerivationModeLength;
///
/// Represents the key for the cryptographic key algorithm that is used to obscure serialized bit fields.
@@ -433,19 +433,19 @@ public TAlgorithm Algorithm
/// Represents the number of key source bytes constituting the iteration sum for PBKDF2-derived keys.
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private const Int32 Pbkdf2IterationSumLengthInBytes = (KeySourceLengthInBytes / 3);
+ private const Int32 Pbkdf2IterationSumLengthInBytes = KeySourceLengthInBytes / 3;
///
/// Represents the number of key source bytes constituting the password for PBKDF2-derived keys.
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private const Int32 Pbkdf2PasswordLengthInBytes = (KeySourceLengthInBytes / 3);
+ private const Int32 Pbkdf2PasswordLengthInBytes = KeySourceLengthInBytes / 3;
///
/// Represents the number of key source bytes constituting the salt for PBKDF2-derived keys.
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private const Int32 Pbkdf2SaltLengthInBytes = (KeySourceLengthInBytes / 3);
+ private const Int32 Pbkdf2SaltLengthInBytes = KeySourceLengthInBytes / 3;
///
/// Represents a finalizer for static members of the class.
diff --git a/src/RapidField.SolidInstruments.Cryptography/CryptographicTransform.cs b/src/RapidField.SolidInstruments.Cryptography/CryptographicTransform.cs
index c10edc7c..6e8fa50d 100644
--- a/src/RapidField.SolidInstruments.Cryptography/CryptographicTransform.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/CryptographicTransform.cs
@@ -41,7 +41,7 @@ internal abstract class CryptographicTransform : Instrument, ICryptoTransform
protected CryptographicTransform(Int32 blockSize, CipherMode mode, PaddingMode paddingMode, EncryptionDirection encryptionDirection)
: base(ConcurrencyControlMode.SingleThreadLock)
{
- BlockSizeInBytes = Convert.ToByte((blockSize.RejectIf().IsLessThanOrEqualTo(0, nameof(blockSize)) / 8));
+ BlockSizeInBytes = Convert.ToByte(blockSize.RejectIf().IsLessThanOrEqualTo(0, nameof(blockSize)) / 8);
EncryptionDirection = encryptionDirection.RejectIf().IsEqualToValue(EncryptionDirection.Unspecified, nameof(encryptionDirection));
Mode = mode;
PaddingMode = paddingMode;
@@ -162,7 +162,7 @@ private static Byte[] ConditionallyApplyPadding(Byte[] block, Int32 blockSizeInB
return block;
}
- var paddingLengthInBytes = (blockSizeInBytes - block.Length);
+ var paddingLengthInBytes = blockSizeInBytes - block.Length;
if (paddingLengthInBytes <= 0)
{
@@ -238,7 +238,7 @@ private static Byte[] ConditionallyRemovePadding(Byte[] block, Int32 blockSizeIn
var ciphertextByteCount = Convert.ToByte(blockSizeInBytes - paddingLengthInBytes);
var blockWithPaddingRemoved = new Byte[ciphertextByteCount];
- var startPosition = (blockSizeInBytes - 2);
+ var startPosition = blockSizeInBytes - 2;
switch (paddingMode)
{
@@ -304,12 +304,12 @@ private static void TransformRange(List range, CryptographicTransform tran
var encryptionDirection = transform.EncryptionDirection;
var paddingMode = transform.PaddingMode;
var currentLeadingRangeIndex = 0;
- var nextLeadingRangeIndex = (currentLeadingRangeIndex + blockSizeInBytes);
+ var nextLeadingRangeIndex = currentLeadingRangeIndex + blockSizeInBytes;
var currentBlock = (Byte[])null;
while (currentLeadingRangeIndex < range.Count)
{
- var currentBlockIsFinalBlock = (nextLeadingRangeIndex >= range.Count);
+ var currentBlockIsFinalBlock = nextLeadingRangeIndex >= range.Count;
switch (encryptionDirection)
{
@@ -341,12 +341,12 @@ private static void TransformRange(List range, CryptographicTransform tran
if (currentBlockIsFinalBlock)
{
currentBlock = ConditionallyRemovePadding(currentBlock, blockSizeInBytes, paddingMode);
- var countOfPaddingBytesRemoved = (blockSizeInBytes - currentBlock.Length);
+ var countOfPaddingBytesRemoved = blockSizeInBytes - currentBlock.Length;
if (countOfPaddingBytesRemoved > 0)
{
// Contract the range to account for cleared padding bytes.
- range.RemoveRange((currentLeadingRangeIndex + currentBlock.Length), countOfPaddingBytesRemoved);
+ range.RemoveRange(currentLeadingRangeIndex + currentBlock.Length, countOfPaddingBytesRemoved);
}
}
@@ -392,7 +392,7 @@ private static void TransformRange(List range, CryptographicTransform tran
///
/// Gets the block size, in bits.
///
- protected Int32 BlockSizeInBits => (BlockSizeInBytes * 8);
+ protected Int32 BlockSizeInBits => BlockSizeInBytes * 8;
///
/// Gets the block size, in bytes.
diff --git a/src/RapidField.SolidInstruments.Cryptography/Extensions/IEnumerableExtensions.cs b/src/RapidField.SolidInstruments.Cryptography/Extensions/IEnumerableExtensions.cs
index dec87919..99074af5 100644
--- a/src/RapidField.SolidInstruments.Cryptography/Extensions/IEnumerableExtensions.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/Extensions/IEnumerableExtensions.cs
@@ -46,7 +46,7 @@ public static T SelectRandom(this IEnumerable target, RandomNumberGenerato
throw new InvalidOperationException($"{nameof(SelectRandom)} cannot be invoked on an empty collection.");
}
- return target.ElementAt(randomnessProvider.GetInt32(0, (collectionLength - 1)));
+ return target.ElementAt(randomnessProvider.GetInt32(0, collectionLength - 1));
}
}
}
\ No newline at end of file
diff --git a/src/RapidField.SolidInstruments.Cryptography/Extensions/RandomNumberGeneratorExtensions.cs b/src/RapidField.SolidInstruments.Cryptography/Extensions/RandomNumberGeneratorExtensions.cs
index 60b7edd4..10a509a2 100644
--- a/src/RapidField.SolidInstruments.Cryptography/Extensions/RandomNumberGeneratorExtensions.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/Extensions/RandomNumberGeneratorExtensions.cs
@@ -1668,7 +1668,7 @@ private static void GenerateChar(RandomNumberGenerator target, Boolean permitNon
var characterEncoding = permitNonLatin ? Encoding.Unicode : Encoding.ASCII;
var characterByteLength = permitNonLatin ? UnicodeCharByteLength : AsciiCharByteLength;
var characterBytes = new Byte[characterByteLength * CharacterBytesLengthMultiplier];
- var singlePassIterationCount = (characterBytes.Length - characterByteLength);
+ var singlePassIterationCount = characterBytes.Length - characterByteLength;
target.GetBytes(characterBytes);
while (PermuteCharacterGeneration(characterBytes, singlePassIterationCount, characterByteLength, characterEncoding, permitNonLatin, permitLowercaseAlphabetic, permitUppercaseAlphabetic, permitNumeric, permitSymbolic, permitWhiteSpace, permitControl, out randomValue) == false)
@@ -1760,8 +1760,8 @@ private static void GenerateDecimal(RandomNumberGenerator target, out Decimal ra
[DebuggerHidden]
private static void GenerateDecimal(RandomNumberGenerator target, Decimal floor, Decimal ceiling, out Decimal randomValue)
{
- GenerateRangePosition(target, (ceiling - floor), out var rangePosition);
- randomValue = (floor + rangePosition);
+ GenerateRangePosition(target, ceiling - floor, out var rangePosition);
+ randomValue = floor + rangePosition;
}
///
@@ -1801,7 +1801,7 @@ private static void GenerateDouble(RandomNumberGenerator target, Double floor, D
{
var range = Convert.ToDecimal(ceiling - floor);
GenerateRangePosition(target, range, out var rangePosition);
- randomValue = (floor + Convert.ToDouble(rangePosition));
+ randomValue = floor + Convert.ToDouble(rangePosition);
}
///
@@ -1950,7 +1950,7 @@ private static void GenerateRangePosition(RandomNumberGenerator target, Decimal
}
var rationalMultiplier = new Decimal(lowBits, middleBits, Convert.ToInt32(highBits), false, 28);
- rangePosition = (range * rationalMultiplier);
+ rangePosition = range * rationalMultiplier;
}
///
@@ -1990,7 +1990,7 @@ private static void GenerateSingle(RandomNumberGenerator target, Single floor, S
{
var range = Convert.ToDecimal(ceiling - floor);
GenerateRangePosition(target, range, out var rangePosition);
- randomValue = (floor + Convert.ToSingle(rangePosition));
+ randomValue = floor + Convert.ToSingle(rangePosition);
}
///
@@ -2127,7 +2127,7 @@ private static void GenerateUInt16(RandomNumberGenerator target, out UInt16 rand
[DebuggerHidden]
private static void GenerateUInt16(RandomNumberGenerator target, UInt16 floor, UInt16 ceiling, out UInt16 randomValue)
{
- var range = (ceiling - floor);
+ var range = ceiling - floor;
GenerateRangePosition(target, range, out var rangePosition);
randomValue = Convert.ToUInt16(floor + rangePosition.RoundedTo(0));
}
@@ -2167,7 +2167,7 @@ private static void GenerateUInt32(RandomNumberGenerator target, out UInt32 rand
[DebuggerHidden]
private static void GenerateUInt32(RandomNumberGenerator target, UInt32 floor, UInt32 ceiling, out UInt32 randomValue)
{
- var range = (ceiling - floor);
+ var range = ceiling - floor;
GenerateRangePosition(target, range, out var rangePosition);
randomValue = Convert.ToUInt32(floor + rangePosition.RoundedTo(0));
}
diff --git a/src/RapidField.SolidInstruments.Cryptography/HardenedRandomNumberGenerator.cs b/src/RapidField.SolidInstruments.Cryptography/HardenedRandomNumberGenerator.cs
index 956419ea..975af4c4 100644
--- a/src/RapidField.SolidInstruments.Cryptography/HardenedRandomNumberGenerator.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/HardenedRandomNumberGenerator.cs
@@ -187,7 +187,7 @@ private void PermuteBuffer()
/// Represents the number of source bytes generated for a single round of .
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private const Int32 BufferPermutationSourceLengthInBytes = (CipherBlockLengthInBytes * 32);
+ private const Int32 BufferPermutationSourceLengthInBytes = CipherBlockLengthInBytes * 32;
///
/// Represents the bit-length of a single block for .
@@ -199,7 +199,7 @@ private void PermuteBuffer()
/// Represents the length of a single block for , in bytes.
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private const Int32 CipherBlockLengthInBytes = (CipherBlockLengthInBits / 8);
+ private const Int32 CipherBlockLengthInBytes = CipherBlockLengthInBits / 8;
///
/// Represents the bit-length of the private key for .
@@ -211,7 +211,7 @@ private void PermuteBuffer()
/// Represents the length of the private key for , in bytes.
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private const Int32 CipherKeyLengthInBytes = (CipherKeyLengthInBits / 8);
+ private const Int32 CipherKeyLengthInBytes = CipherKeyLengthInBits / 8;
///
/// Represents a finalizer for static members of the class.
diff --git a/src/RapidField.SolidInstruments.Cryptography/Hashing/HashTree.cs b/src/RapidField.SolidInstruments.Cryptography/Hashing/HashTree.cs
index ac1f5aa8..b64864f1 100644
--- a/src/RapidField.SolidInstruments.Cryptography/Hashing/HashTree.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/Hashing/HashTree.cs
@@ -242,9 +242,9 @@ private void PermuteRow(IEnumerable row)
return;
}
- var pairCount = (rowCount / 2);
- var pairCountModulus = (rowCount % 2);
- var parentRowLength = (pairCount + pairCountModulus);
+ var pairCount = rowCount / 2;
+ var pairCountModulus = rowCount % 2;
+ var parentRowLength = pairCount + pairCountModulus;
var parentRow = new HashTreeNode[parentRowLength];
for (var i = 0; i < pairCount; i++)
diff --git a/src/RapidField.SolidInstruments.Cryptography/Hashing/HashingProcessor.cs b/src/RapidField.SolidInstruments.Cryptography/Hashing/HashingProcessor.cs
index 39330999..9f0e8df1 100644
--- a/src/RapidField.SolidInstruments.Cryptography/Hashing/HashingProcessor.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/Hashing/HashingProcessor.cs
@@ -192,12 +192,12 @@ internal HashingProcessor()
///
public Byte[] CalculateHash(Byte[] plaintext, HashingAlgorithmSpecification algorithm, Byte[] salt)
{
- var applySalt = (salt is null == false);
- var saltLengthInBytes = (applySalt ? salt.Length : 0);
+ var applySalt = (salt is null) == false;
+ var saltLengthInBytes = applySalt ? salt.Length : 0;
var plaintextLengthInBytes = plaintext.RejectIf().IsNullOrEmpty(nameof(plaintext)).TargetArgument.Length;
- var saltedPlaintextLengthInBytes = (plaintextLengthInBytes + saltLengthInBytes);
- var digestLengthInBytes = (algorithm.RejectIf().IsEqualToValue(HashingAlgorithmSpecification.Unspecified, nameof(algorithm)).TargetArgument.ToDigestBitLength() / 8);
- var hashLengthInBytes = (digestLengthInBytes + saltLengthInBytes);
+ var saltedPlaintextLengthInBytes = plaintextLengthInBytes + saltLengthInBytes;
+ var digestLengthInBytes = algorithm.RejectIf().IsEqualToValue(HashingAlgorithmSpecification.Unspecified, nameof(algorithm)).TargetArgument.ToDigestBitLength() / 8;
+ var hashLengthInBytes = digestLengthInBytes + saltLengthInBytes;
var hashValue = new Byte[hashLengthInBytes];
try
@@ -323,7 +323,7 @@ public Boolean EvaluateHash(Byte[] hash, T plaintextObject, HashingAlgorithmSpec
{
try
{
- var digestLength = (algorithm.RejectIf().IsEqualToValue(HashingAlgorithmSpecification.Unspecified, nameof(algorithm)).TargetArgument.ToDigestBitLength() / 8);
+ var digestLength = algorithm.RejectIf().IsEqualToValue(HashingAlgorithmSpecification.Unspecified, nameof(algorithm)).TargetArgument.ToDigestBitLength() / 8;
Byte[] processedHash;
Byte[] calculatedHash;
diff --git a/src/RapidField.SolidInstruments.Cryptography/Secrets/ExportedSecret.cs b/src/RapidField.SolidInstruments.Cryptography/Secrets/ExportedSecret.cs
index a2ab1bf3..723953f6 100644
--- a/src/RapidField.SolidInstruments.Cryptography/Secrets/ExportedSecret.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/Secrets/ExportedSecret.cs
@@ -135,7 +135,7 @@ private IReadOnlySecret HydrateSecret(Secret secret)
[DataMember]
public Boolean HasValue
{
- get => Value is null == false;
+ get => (Value is null) == false;
set
{
if (value && Value is null)
diff --git a/src/RapidField.SolidInstruments.Cryptography/Symmetric/CascadingSymmetricKey.cs b/src/RapidField.SolidInstruments.Cryptography/Symmetric/CascadingSymmetricKey.cs
index 983fbf4a..ce8031f5 100644
--- a/src/RapidField.SolidInstruments.Cryptography/Symmetric/CascadingSymmetricKey.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/Symmetric/CascadingSymmetricKey.cs
@@ -225,7 +225,7 @@ public static CascadingSymmetricKey FromSecureMemory(ISecureMemory secureMemory)
{
// Interrogate the final 16 bits to determine the depth.
var keyLength = SymmetricKey.SerializedLength;
- var depth = BitConverter.ToUInt16(memory, (SerializedLength - sizeof(UInt16)));
+ var depth = BitConverter.ToUInt16(memory, SerializedLength - sizeof(UInt16));
keys = new ISymmetricKey[depth];
for (var i = 0; i < depth; i++)
@@ -235,7 +235,7 @@ public static CascadingSymmetricKey FromSecureMemory(ISecureMemory secureMemory)
secureMemory.Access(key =>
{
// Copy out the key buffers.
- Array.Copy(memory, (keyLength * i), key, 0, keyLength);
+ Array.Copy(memory, keyLength * i, key, 0, keyLength);
});
keys[i] = SymmetricKey.FromSecureMemory(secureMemory);
@@ -394,7 +394,7 @@ protected sealed override ISecureMemory ToSecureMemory(IConcurrencyControlToken
keyMemory.Access(key =>
{
// Copy the key buffers out to the result buffer.
- Array.Copy(key, 0, pinnedMemory, (keyLength * i), keyLength);
+ Array.Copy(key, 0, pinnedMemory, keyLength * i, keyLength);
});
}
@@ -404,11 +404,11 @@ protected sealed override ISecureMemory ToSecureMemory(IConcurrencyControlToken
// Fill the unused segments with random bytes.
var randomBytes = new Byte[keyLength];
HardenedRandomNumberGenerator.Instance.GetBytes(randomBytes);
- Array.Copy(randomBytes, 0, pinnedMemory, (keyLength * i), keyLength);
+ Array.Copy(randomBytes, 0, pinnedMemory, keyLength * i, keyLength);
}
// Append the depth as a 16-bit integer.
- Buffer.BlockCopy(BitConverter.GetBytes(Convert.ToUInt16(Depth)), 0, pinnedMemory, (SerializedLength - sizeof(UInt16)), sizeof(UInt16));
+ Buffer.BlockCopy(BitConverter.GetBytes(Convert.ToUInt16(Depth)), 0, pinnedMemory, SerializedLength - sizeof(UInt16), sizeof(UInt16));
});
return secureMemory;
@@ -494,7 +494,7 @@ public IEnumerable Keys
/// Represents the number of bytes comprising a serialized representation of a .
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- internal const Int32 SerializedLength = ((SymmetricKey.SerializedLength * MaximumDepth) + sizeof(UInt16));
+ internal const Int32 SerializedLength = (SymmetricKey.SerializedLength * MaximumDepth) + sizeof(UInt16);
///
/// Represents the default derivation mode for new keys.
diff --git a/src/RapidField.SolidInstruments.Cryptography/Symmetric/SymmetricKeyCipher.cs b/src/RapidField.SolidInstruments.Cryptography/Symmetric/SymmetricKeyCipher.cs
index cceedb27..25a80f54 100644
--- a/src/RapidField.SolidInstruments.Cryptography/Symmetric/SymmetricKeyCipher.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/Symmetric/SymmetricKeyCipher.cs
@@ -159,7 +159,7 @@ private PinnedMemory DecryptInCbcMode(PinnedMemory ciphertext, PinnedMemory priv
{
Array.Copy(ciphertext, 0, initializationVector, 0, BlockSizeInBytes);
- using (var cipherTextSansInitializationVector = new PinnedMemory((ciphertext.Length - BlockSizeInBytes), true))
+ using (var cipherTextSansInitializationVector = new PinnedMemory(ciphertext.Length - BlockSizeInBytes, true))
{
Array.Copy(ciphertext, BlockSizeInBytes, cipherTextSansInitializationVector, 0, cipherTextSansInitializationVector.Length);
@@ -319,7 +319,7 @@ private PinnedMemory EncryptInEcbMode(PinnedMemory plaintext, PinnedMemory priva
/// Gets the number of bytes per block for the cipher represented by this .
///
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
- internal Int32 BlockSizeInBytes => (BlockSizeInBits / 8);
+ internal Int32 BlockSizeInBytes => BlockSizeInBits / 8;
///
/// Gets the number of key bytes for the cipher represented by this .
diff --git a/src/RapidField.SolidInstruments.Cryptography/Symmetric/SymmetricProcessor.cs b/src/RapidField.SolidInstruments.Cryptography/Symmetric/SymmetricProcessor.cs
index 07a46fe8..8acea394 100644
--- a/src/RapidField.SolidInstruments.Cryptography/Symmetric/SymmetricProcessor.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/Symmetric/SymmetricProcessor.cs
@@ -165,7 +165,7 @@ public T Decrypt(Byte[] ciphertext, ICascadingSymmetricKey key)
var decryptor = new SymmetricProcessor(RandomnessProvider);
var buffer = ciphertext;
- for (var i = (key.Depth - 1); i > 0; i--)
+ for (var i = key.Depth - 1; i > 0; i--)
{
buffer = decryptor.Decrypt(buffer, keys.ElementAt(i));
}
diff --git a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/ConfiguredContext.cs b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/ConfiguredContext.cs
index b37ed522..51dcc3d4 100644
--- a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/ConfiguredContext.cs
+++ b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/ConfiguredContext.cs
@@ -355,7 +355,7 @@ private static String GetConventionalDatabaseName(Type contextType)
}
else if (contextTypeName.EndsWith(ContextPostfixStringElement))
{
- return contextTypeName.Substring(0, (contextTypeName.Length - ContextPostfixStringElement.Length));
+ return contextTypeName.Substring(0, contextTypeName.Length - ContextPostfixStringElement.Length);
}
return contextTypeName;
diff --git a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkDataAccessModel.cs b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkDataAccessModel.cs
new file mode 100644
index 00000000..c033b760
--- /dev/null
+++ b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkDataAccessModel.cs
@@ -0,0 +1,438 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.Core;
+using RapidField.SolidInstruments.Core.ArgumentValidation;
+using RapidField.SolidInstruments.Core.Domain;
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.Serialization;
+
+namespace RapidField.SolidInstruments.DataAccess.EntityFramework
+{
+ ///
+ /// Represents an object that models an Entity Framework entity.
+ ///
+ ///
+ /// The type of the value that uniquely identifies the model.
+ ///
+ ///
+ /// The type of the domain model to which the data access model is mapped.
+ ///
+ [DataContract]
+ public abstract class EntityFrameworkDataAccessModel : EntityFrameworkDataAccessModel, IDataAccessModel
+ where TIdentifier : IComparable, IComparable, IEquatable
+ where TDomainModel : class, IDomainModel, new()
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected EntityFrameworkDataAccessModel()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A value that uniquely identifies the model. The default value is equal to the default instance of
+ /// .
+ ///
+ protected EntityFrameworkDataAccessModel(TIdentifier identifier)
+ : base(identifier)
+ {
+ return;
+ }
+
+ ///
+ /// Copies the state of the specified domain model to the current
+ /// .
+ ///
+ ///
+ /// A domain model from which to hydrate the state of the data access model.
+ ///
+ ///
+ /// The state of is invalid.
+ ///
+ ///
+ /// is .
+ ///
+ public void HydrateFromDomainModel(TDomainModel domainModel)
+ {
+ _ = domainModel.RejectIf().IsNull(nameof(domainModel));
+
+ try
+ {
+ HydrateModel(domainModel, this);
+ }
+ catch (Exception exception)
+ {
+ throw new ArgumentException($"Failed to hydrate a data access model (type: {GetType().FullName}) from the specified domain model (type: {typeof(TDomainModel).FullName}). See inner exception.", nameof(domainModel), exception);
+ }
+ }
+
+ ///
+ /// Converts the current to its equivalent domain
+ /// model representation.
+ ///
+ ///
+ /// An that is equivalent to the current data access model.
+ ///
+ ///
+ /// An exception was raised while converting the data access model to its equivalent domain model.
+ ///
+ public TDomainModel ToDomainModel()
+ {
+ try
+ {
+ var domainModel = new TDomainModel();
+ HydrateModel(this, domainModel);
+ return domainModel;
+ }
+ catch (Exception exception)
+ {
+ throw new TypeInitializationException(typeof(TDomainModel).FullName, exception);
+ }
+ }
+
+ ///
+ /// Copies the state of the specified source model to the specified target model.
+ ///
+ ///
+ /// The model from which state is derived.
+ ///
+ ///
+ /// The model to which state is copied.
+ ///
+ ///
+ /// is -or- is
+ /// .
+ ///
+ [DebuggerHidden]
+ private static void HydrateModel(IModel sourceModel, IModel targetModel)
+ {
+ var sourceModelType = sourceModel.RejectIf().IsNull(nameof(sourceModel)).TargetArgument.GetType();
+ 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);
+
+ foreach (var sourcePropertyElement in sourceModelProperties)
+ {
+ var propertyName = sourcePropertyElement.Key;
+ var sourcePropertyValue = sourcePropertyElement.Value.CanRead ? sourcePropertyElement.Value.GetValue(sourceModel) : null;
+
+ if (targetModelProperties.ContainsKey(propertyName) && (sourcePropertyValue is null) == false)
+ {
+ var targetProperty = targetModelProperties[propertyName];
+ var sourcePropertyValueType = sourcePropertyValue.GetType();
+
+ if (targetProperty.CanWrite && targetProperty.PropertyType == sourcePropertyValueType)
+ {
+ targetProperty.SetValue(targetModel, sourcePropertyValue);
+ }
+ }
+ }
+ }
+
+ ///
+ /// Represents binding flags that are used to find public instance properties of a model.
+ ///
+ [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+ private const BindingFlags PropertyBindingFlags = BindingFlags.Instance | BindingFlags.Public;
+ }
+
+ ///
+ /// Represents an object that models an Entity Framework entity.
+ ///
+ ///
+ /// The type of the value that uniquely identifies the model.
+ ///
+ [DataContract]
+ public abstract class EntityFrameworkDataAccessModel : EntityFrameworkDataAccessModel, IDataAccessModel
+ where TIdentifier : IComparable, IComparable, IEquatable
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected EntityFrameworkDataAccessModel()
+ : this(default)
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A value that uniquely identifies the model. The default value is equal to the default instance of
+ /// .
+ ///
+ protected EntityFrameworkDataAccessModel(TIdentifier identifier)
+ : base()
+ {
+ Identifier = identifier;
+ }
+
+ ///
+ /// Determines whether or not two specified instances are not equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are not equal.
+ ///
+ public static Boolean operator !=(EntityFrameworkDataAccessModel a, IDataAccessModel b) => a == b == false;
+
+ ///
+ /// Determines whether or not a specified instance is less than another
+ /// specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than the first object, otherwise .
+ ///
+ public static Boolean operator <(EntityFrameworkDataAccessModel a, IDataAccessModel b) => a is null ? b is Object : a.CompareTo(b) < 0;
+
+ ///
+ /// Determines whether or not a specified instance is less than or equal to
+ /// another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator <=(EntityFrameworkDataAccessModel a, IDataAccessModel b) => a is null || a.CompareTo(b) <= 0;
+
+ ///
+ /// Determines whether or not two specified instances are equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public static Boolean operator ==(EntityFrameworkDataAccessModel a, IDataAccessModel b)
+ {
+ if (a is null && b is null)
+ {
+ return true;
+ }
+ else if (a is null || b is null)
+ {
+ return false;
+ }
+
+ return a.Equals(b);
+ }
+
+ ///
+ /// Determines whether or not a specified instance is greater than another
+ /// specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than the first object, otherwise .
+ ///
+ public static Boolean operator >(EntityFrameworkDataAccessModel a, IDataAccessModel b) => a is Object && a.CompareTo(b) > 0;
+
+ ///
+ /// Determines whether or not a specified instance is greater than or equal to
+ /// another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator >=(EntityFrameworkDataAccessModel a, IDataAccessModel b) => a is null ? b is null : a.CompareTo(b) >= 0;
+
+ ///
+ /// Compares the current to the specified object and returns an
+ /// indication of their relative values.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// Negative one if this instance is earlier than the specified instance; one if this instance is later than the supplied
+ /// instance; zero if they are equal.
+ ///
+ public Int32 CompareTo(IDataAccessModel other) => Identifier.CompareTo(other.Identifier);
+
+ ///
+ /// Determines whether or not the current is equal to the
+ /// specified .
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public override Boolean Equals(Object obj) => base.Equals(obj);
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer hash code.
+ ///
+ public override Int32 GetHashCode() => base.GetHashCode();
+
+ ///
+ /// Converts the value of the current to its equivalent string
+ /// representation.
+ ///
+ ///
+ /// A string representation of the current .
+ ///
+ public override String ToString() => $"{{ \"{nameof(Identifier)}\": \"{Identifier}\" }}";
+
+ ///
+ /// Gets or sets a value that uniquely identifies the current .
+ ///
+ [Column(Order = 0)]
+ [DataMember]
+ [Key]
+ public TIdentifier Identifier
+ {
+ get;
+ set;
+ }
+ }
+
+ ///
+ /// Represents an object that models an Entity Framework entity.
+ ///
+ [DataContract]
+ public abstract class EntityFrameworkDataAccessModel : Model, IDataAccessModel
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected EntityFrameworkDataAccessModel()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Determines whether or not two specified instances are not equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are not equal.
+ ///
+ public static Boolean operator !=(EntityFrameworkDataAccessModel a, IDataAccessModel b) => a == b == false;
+
+ ///
+ /// Determines whether or not two specified instances are equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public static Boolean operator ==(EntityFrameworkDataAccessModel a, IDataAccessModel b)
+ {
+ if (a is null && b is null)
+ {
+ return true;
+ }
+ else if (a is null || b is null)
+ {
+ return false;
+ }
+
+ return a.Equals(b);
+ }
+
+ ///
+ /// Determines whether or not the current is equal to the specified
+ /// .
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public override Boolean Equals(Object obj) => base.Equals(obj);
+
+ ///
+ /// Determines whether or not two specified instances are equal.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public Boolean Equals(IDataAccessModel other)
+ {
+ if ((Object)other is null)
+ {
+ return false;
+ }
+ else if (GetHashCode() != other.GetHashCode())
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer hash code.
+ ///
+ public override Int32 GetHashCode() => base.GetHashCode();
+ }
+}
\ No newline at end of file
diff --git a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkGlobalIdentityDataAccessModel.cs b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkGlobalIdentityDataAccessModel.cs
new file mode 100644
index 00000000..2538b55c
--- /dev/null
+++ b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkGlobalIdentityDataAccessModel.cs
@@ -0,0 +1,366 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.Core;
+using RapidField.SolidInstruments.Core.Domain;
+using System;
+using System.Runtime.Serialization;
+
+namespace RapidField.SolidInstruments.DataAccess.EntityFramework
+{
+ ///
+ /// Represents an object that models an Entity Framework entity and that is identified primarily by a value.
+ ///
+ ///
+ /// The type of the domain model to which the data access model is mapped.
+ ///
+ [DataContract]
+ public abstract class EntityFrameworkGlobalIdentityDataAccessModel : EntityFrameworkDataAccessModel, IGlobalIdentityDataAccessModel
+ where TDomainModel : class, IGlobalIdentityDomainModel, new()
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected EntityFrameworkGlobalIdentityDataAccessModel()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A value that uniquely identifies the model. The default value is equal to the default instance of .
+ ///
+ protected EntityFrameworkGlobalIdentityDataAccessModel(Guid identifier)
+ : base(identifier)
+ {
+ return;
+ }
+
+ ///
+ /// Determines whether or not two specified
+ /// instances are not equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are not equal.
+ ///
+ public static Boolean operator !=(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b) => a == b == false;
+
+ ///
+ /// Determines whether or not a specified instance
+ /// is less than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than the first object, otherwise .
+ ///
+ public static Boolean operator <(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b) => a is null ? b is Object : a.CompareTo(b) < 0;
+
+ ///
+ /// Determines whether or not a specified instance
+ /// is less than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator <=(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b) => a is null || a.CompareTo(b) <= 0;
+
+ ///
+ /// Determines whether or not two specified
+ /// instances are equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public static Boolean operator ==(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b)
+ {
+ if (a is null && b is null)
+ {
+ return true;
+ }
+ else if (a is null || b is null)
+ {
+ return false;
+ }
+
+ return a.Equals(b);
+ }
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than the first object, otherwise .
+ ///
+ public static Boolean operator >(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b) => a is Object && a.CompareTo(b) > 0;
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator >=(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b) => a is null ? b is null : a.CompareTo(b) >= 0;
+
+ ///
+ /// Compares the current to the specified object
+ /// and returns an indication of their relative values.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// Negative one if this instance is earlier than the specified instance; one if this instance is later than the supplied
+ /// instance; zero if they are equal.
+ ///
+ public Int32 CompareTo(IModel other) => Identifier.CompareTo(other.Identifier);
+
+ ///
+ /// Determines whether or not the current is equal
+ /// to the specified .
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public override Boolean Equals(Object obj) => base.Equals(obj);
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer hash code.
+ ///
+ public override Int32 GetHashCode() => base.GetHashCode();
+ }
+
+ ///
+ /// Represents an object that models an Entity Framework entity and that is identified primarily by a value.
+ ///
+ [DataContract]
+ public abstract class EntityFrameworkGlobalIdentityDataAccessModel : EntityFrameworkDataAccessModel, IGlobalIdentityDataAccessModel
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected EntityFrameworkGlobalIdentityDataAccessModel()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A value that uniquely identifies the model. The default value is equal to the default instance of .
+ ///
+ protected EntityFrameworkGlobalIdentityDataAccessModel(Guid identifier)
+ : base(identifier)
+ {
+ return;
+ }
+
+ ///
+ /// Determines whether or not two specified instances are not equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are not equal.
+ ///
+ public static Boolean operator !=(EntityFrameworkGlobalIdentityDataAccessModel a, IDataAccessModel b) => a == b == false;
+
+ ///
+ /// Determines whether or not a specified instance is less than
+ /// another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than the first object, otherwise .
+ ///
+ public static Boolean operator <(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b) => a is null ? b is Object : a.CompareTo(b) < 0;
+
+ ///
+ /// Determines whether or not a specified instance is less than
+ /// or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator <=(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b) => a is null || a.CompareTo(b) <= 0;
+
+ ///
+ /// Determines whether or not two specified instances are equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public static Boolean operator ==(EntityFrameworkGlobalIdentityDataAccessModel a, IDataAccessModel b)
+ {
+ if (a is null && b is null)
+ {
+ return true;
+ }
+ else if (a is null || b is null)
+ {
+ return false;
+ }
+
+ return a.Equals(b);
+ }
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than the first object, otherwise .
+ ///
+ public static Boolean operator >(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b) => a is Object && a.CompareTo(b) > 0;
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator >=(EntityFrameworkGlobalIdentityDataAccessModel a, EntityFrameworkGlobalIdentityDataAccessModel b) => a is null ? b is null : a.CompareTo(b) >= 0;
+
+ ///
+ /// Compares the current to the specified object and returns an
+ /// indication of their relative values.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// Negative one if this instance is earlier than the specified instance; one if this instance is later than the supplied
+ /// instance; zero if they are equal.
+ ///
+ public Int32 CompareTo(IModel other) => Identifier.CompareTo(other.Identifier);
+
+ ///
+ /// Determines whether or not the current is equal to the
+ /// specified .
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public override Boolean Equals(Object obj) => base.Equals(obj);
+
+ ///
+ /// Determines whether or not two specified instances are equal.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public Boolean Equals(IGlobalIdentityDataAccessModel other)
+ {
+ if ((Object)other is null)
+ {
+ return false;
+ }
+ else if (GetHashCode() != other.GetHashCode())
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer hash code.
+ ///
+ public override Int32 GetHashCode() => base.GetHashCode();
+ }
+}
\ No newline at end of file
diff --git a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkNumericIdentityDataAccessModel.cs b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkNumericIdentityDataAccessModel.cs
new file mode 100644
index 00000000..706e19c7
--- /dev/null
+++ b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkNumericIdentityDataAccessModel.cs
@@ -0,0 +1,368 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.Core;
+using RapidField.SolidInstruments.Core.Domain;
+using System;
+using System.Runtime.Serialization;
+
+namespace RapidField.SolidInstruments.DataAccess.EntityFramework
+{
+ ///
+ /// Represents an object that models an Entity Framework entity and that is identified primarily by a
+ /// value.
+ ///
+ ///
+ /// The type of the domain model to which the data access model is mapped.
+ ///
+ [DataContract]
+ public abstract class EntityFrameworkNumericIdentityDataAccessModel : EntityFrameworkDataAccessModel, INumericIdentityDataAccessModel
+ where TDomainModel : class, INumericIdentityDomainModel, new()
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected EntityFrameworkNumericIdentityDataAccessModel()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A value that uniquely identifies the model. The default value is equal to the default instance of .
+ ///
+ protected EntityFrameworkNumericIdentityDataAccessModel(Int64 identifier)
+ : base(identifier)
+ {
+ return;
+ }
+
+ ///
+ /// Determines whether or not two specified
+ /// instances are not equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are not equal.
+ ///
+ public static Boolean operator !=(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b) => a == b == false;
+
+ ///
+ /// Determines whether or not a specified
+ /// instance is less than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than the first object, otherwise .
+ ///
+ public static Boolean operator <(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b) => a is null ? b is Object : a.CompareTo(b) < 0;
+
+ ///
+ /// Determines whether or not a specified
+ /// instance is less than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator <=(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b) => a is null || a.CompareTo(b) <= 0;
+
+ ///
+ /// Determines whether or not two specified
+ /// instances are equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public static Boolean operator ==(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b)
+ {
+ if (a is null && b is null)
+ {
+ return true;
+ }
+ else if (a is null || b is null)
+ {
+ return false;
+ }
+
+ return a.Equals(b);
+ }
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than the first object, otherwise .
+ ///
+ public static Boolean operator >(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b) => a is Object && a.CompareTo(b) > 0;
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator >=(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b) => a is null ? b is null : a.CompareTo(b) >= 0;
+
+ ///
+ /// Compares the current to the specified object
+ /// and returns an indication of their relative values.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// Negative one if this instance is earlier than the specified instance; one if this instance is later than the supplied
+ /// instance; zero if they are equal.
+ ///
+ public Int32 CompareTo(IModel other) => Identifier.CompareTo(other.Identifier);
+
+ ///
+ /// Determines whether or not the current is
+ /// equal to the specified .
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public override Boolean Equals(Object obj) => base.Equals(obj);
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer hash code.
+ ///
+ public override Int32 GetHashCode() => base.GetHashCode();
+ }
+
+ ///
+ /// Represents an object that models an Entity Framework entity and that is identified primarily by a
+ /// value.
+ ///
+ [DataContract]
+ public abstract class EntityFrameworkNumericIdentityDataAccessModel : EntityFrameworkDataAccessModel, INumericIdentityDataAccessModel
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected EntityFrameworkNumericIdentityDataAccessModel()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A value that uniquely identifies the model. The default value is equal to the default instance of .
+ ///
+ protected EntityFrameworkNumericIdentityDataAccessModel(Int64 identifier)
+ : base(identifier)
+ {
+ return;
+ }
+
+ ///
+ /// Determines whether or not two specified instances are not equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are not equal.
+ ///
+ public static Boolean operator !=(EntityFrameworkNumericIdentityDataAccessModel a, IDataAccessModel b) => a == b == false;
+
+ ///
+ /// Determines whether or not a specified instance is less than
+ /// another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than the first object, otherwise .
+ ///
+ public static Boolean operator <(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b) => a is null ? b is Object : a.CompareTo(b) < 0;
+
+ ///
+ /// Determines whether or not a specified instance is less than
+ /// or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator <=(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b) => a is null || a.CompareTo(b) <= 0;
+
+ ///
+ /// Determines whether or not two specified instances are equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public static Boolean operator ==(EntityFrameworkNumericIdentityDataAccessModel a, IDataAccessModel b)
+ {
+ if (a is null && b is null)
+ {
+ return true;
+ }
+ else if (a is null || b is null)
+ {
+ return false;
+ }
+
+ return a.Equals(b);
+ }
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than the first object, otherwise .
+ ///
+ public static Boolean operator >(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b) => a is Object && a.CompareTo(b) > 0;
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator >=(EntityFrameworkNumericIdentityDataAccessModel a, EntityFrameworkNumericIdentityDataAccessModel b) => a is null ? b is null : a.CompareTo(b) >= 0;
+
+ ///
+ /// Compares the current to the specified object and returns an
+ /// indication of their relative values.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// Negative one if this instance is earlier than the specified instance; one if this instance is later than the supplied
+ /// instance; zero if they are equal.
+ ///
+ public Int32 CompareTo(IModel other) => Identifier.CompareTo(other.Identifier);
+
+ ///
+ /// Determines whether or not the current is equal to the
+ /// specified .
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public override Boolean Equals(Object obj) => base.Equals(obj);
+
+ ///
+ /// Determines whether or not two specified instances are equal.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public Boolean Equals(INumericIdentityDataAccessModel other)
+ {
+ if ((Object)other is null)
+ {
+ return false;
+ }
+ else if (GetHashCode() != other.GetHashCode())
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer hash code.
+ ///
+ public override Int32 GetHashCode() => base.GetHashCode();
+ }
+}
\ No newline at end of file
diff --git a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkRepository.cs b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkRepository.cs
index 6c0f8f38..7d3a4aba 100644
--- a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkRepository.cs
+++ b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkRepository.cs
@@ -35,7 +35,7 @@ namespace RapidField.SolidInstruments.DataAccess.EntityFramework
///
public class EntityFrameworkRepository : EntityFrameworkRepository, IEntityFrameworkRepository
where TIdentifier : IComparable, IComparable, IEquatable
- where TDomainModel : class, IDomainModel
+ where TDomainModel : class, IDomainModel, new()
where TDataAccessModel : class, IDataAccessModel, new()
where TContext : DbContext
{
diff --git a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkSemanticIdentityDataAccessModel.cs b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkSemanticIdentityDataAccessModel.cs
new file mode 100644
index 00000000..3ce13d45
--- /dev/null
+++ b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/EntityFrameworkSemanticIdentityDataAccessModel.cs
@@ -0,0 +1,368 @@
+// =================================================================================================================================
+// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
+// =================================================================================================================================
+
+using RapidField.SolidInstruments.Core;
+using RapidField.SolidInstruments.Core.Domain;
+using System;
+using System.Runtime.Serialization;
+
+namespace RapidField.SolidInstruments.DataAccess.EntityFramework
+{
+ ///
+ /// Represents an object that models an Entity Framework entity and that is identified primarily by a
+ /// value.
+ ///
+ ///
+ /// The type of the domain model to which the data access model is mapped.
+ ///
+ [DataContract]
+ public abstract class EntityFrameworkSemanticIdentityDataAccessModel : EntityFrameworkDataAccessModel, ISemanticIdentityDataAccessModel
+ where TDomainModel : class, ISemanticIdentityDomainModel, new()
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected EntityFrameworkSemanticIdentityDataAccessModel()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A value that uniquely identifies the model. The default value is equal to the default instance of .
+ ///
+ protected EntityFrameworkSemanticIdentityDataAccessModel(String identifier)
+ : base(identifier)
+ {
+ return;
+ }
+
+ ///
+ /// Determines whether or not two specified
+ /// instances are not equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are not equal.
+ ///
+ public static Boolean operator !=(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b) => a == b == false;
+
+ ///
+ /// Determines whether or not a specified
+ /// instance is less than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than the first object, otherwise .
+ ///
+ public static Boolean operator <(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b) => a is null ? b is Object : a.CompareTo(b) < 0;
+
+ ///
+ /// Determines whether or not a specified
+ /// instance is less than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator <=(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b) => a is null || a.CompareTo(b) <= 0;
+
+ ///
+ /// Determines whether or not two specified
+ /// instances are equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public static Boolean operator ==(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b)
+ {
+ if (a is null && b is null)
+ {
+ return true;
+ }
+ else if (a is null || b is null)
+ {
+ return false;
+ }
+
+ return a.Equals(b);
+ }
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than the first object, otherwise .
+ ///
+ public static Boolean operator >(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b) => a is Object && a.CompareTo(b) > 0;
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator >=(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b) => a is null ? b is null : a.CompareTo(b) >= 0;
+
+ ///
+ /// Compares the current to the specified object
+ /// and returns an indication of their relative values.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// Negative one if this instance is earlier than the specified instance; one if this instance is later than the supplied
+ /// instance; zero if they are equal.
+ ///
+ public Int32 CompareTo(IModel other) => Identifier.CompareTo(other.Identifier);
+
+ ///
+ /// Determines whether or not the current is
+ /// equal to the specified .
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public override Boolean Equals(Object obj) => base.Equals(obj);
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer hash code.
+ ///
+ public override Int32 GetHashCode() => base.GetHashCode();
+ }
+
+ ///
+ /// Represents an object that models an Entity Framework entity and that is identified primarily by a
+ /// value.
+ ///
+ [DataContract]
+ public abstract class EntityFrameworkSemanticIdentityDataAccessModel : EntityFrameworkDataAccessModel, ISemanticIdentityDataAccessModel
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ protected EntityFrameworkSemanticIdentityDataAccessModel()
+ : base()
+ {
+ return;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// A value that uniquely identifies the model. The default value is equal to the default instance of .
+ ///
+ protected EntityFrameworkSemanticIdentityDataAccessModel(String identifier)
+ : base(identifier)
+ {
+ return;
+ }
+
+ ///
+ /// Determines whether or not two specified instances are not equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are not equal.
+ ///
+ public static Boolean operator !=(EntityFrameworkSemanticIdentityDataAccessModel a, IDataAccessModel b) => a == b == false;
+
+ ///
+ /// Determines whether or not a specified instance is less
+ /// than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than the first object, otherwise .
+ ///
+ public static Boolean operator <(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b) => a is null ? b is Object : a.CompareTo(b) < 0;
+
+ ///
+ /// Determines whether or not a specified instance is less
+ /// than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is earlier than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator <=(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b) => a is null || a.CompareTo(b) <= 0;
+
+ ///
+ /// Determines whether or not two specified instances are equal.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public static Boolean operator ==(EntityFrameworkSemanticIdentityDataAccessModel a, IDataAccessModel b)
+ {
+ if (a is null && b is null)
+ {
+ return true;
+ }
+ else if (a is null || b is null)
+ {
+ return false;
+ }
+
+ return a.Equals(b);
+ }
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than another specified instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than the first object, otherwise .
+ ///
+ public static Boolean operator >(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b) => a is Object && a.CompareTo(b) > 0;
+
+ ///
+ /// Determines whether or not a specified instance is greater
+ /// than or equal to another supplied instance.
+ ///
+ ///
+ /// The first instance to compare.
+ ///
+ ///
+ /// The second instance to compare.
+ ///
+ ///
+ /// if the second object is later than or equal to the first object, otherwise
+ /// .
+ ///
+ public static Boolean operator >=(EntityFrameworkSemanticIdentityDataAccessModel a, EntityFrameworkSemanticIdentityDataAccessModel b) => a is null ? b is null : a.CompareTo(b) >= 0;
+
+ ///
+ /// Compares the current to the specified object and returns
+ /// an indication of their relative values.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// Negative one if this instance is earlier than the specified instance; one if this instance is later than the supplied
+ /// instance; zero if they are equal.
+ ///
+ public Int32 CompareTo(IModel other) => Identifier.CompareTo(other.Identifier);
+
+ ///
+ /// Determines whether or not the current is equal to the
+ /// specified .
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public override Boolean Equals(Object obj) => base.Equals(obj);
+
+ ///
+ /// Determines whether or not two specified instances are equal.
+ ///
+ ///
+ /// The to compare to this instance.
+ ///
+ ///
+ /// A value indicating whether or not the specified instances are equal.
+ ///
+ public Boolean Equals(ISemanticIdentityDataAccessModel other)
+ {
+ if ((Object)other is null)
+ {
+ return false;
+ }
+ else if (GetHashCode() != other.GetHashCode())
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Returns the hash code for this instance.
+ ///
+ ///
+ /// A 32-bit signed integer hash code.
+ ///
+ public override Int32 GetHashCode() => base.GetHashCode();
+ }
+}
\ No newline at end of file
diff --git a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/IEntityFrameworkRepository.cs b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/IEntityFrameworkRepository.cs
index 7a20fb02..b7e4760e 100644
--- a/src/RapidField.SolidInstruments.DataAccess.EntityFramework/IEntityFrameworkRepository.cs
+++ b/src/RapidField.SolidInstruments.DataAccess.EntityFramework/IEntityFrameworkRepository.cs
@@ -25,7 +25,7 @@ namespace RapidField.SolidInstruments.DataAccess.EntityFramework
///
public interface IEntityFrameworkRepository : IEntityFrameworkRepository, IDomainModelRepository
where TIdentifier : IComparable, IComparable, IEquatable
- where TDomainModel : class, IDomainModel
+ where TDomainModel : class, IDomainModel, new()
where TDataAccessModel : class, IDataAccessModel, new()
where TContext : DbContext
{
diff --git a/src/RapidField.SolidInstruments.DataAccess/CreateDomainModelCommandHandler.cs b/src/RapidField.SolidInstruments.DataAccess/CreateDomainModelCommandHandler.cs
index 818128fd..af459f5f 100644
--- a/src/RapidField.SolidInstruments.DataAccess/CreateDomainModelCommandHandler.cs
+++ b/src/RapidField.SolidInstruments.DataAccess/CreateDomainModelCommandHandler.cs
@@ -27,7 +27,7 @@ namespace RapidField.SolidInstruments.DataAccess
///
public class CreateDomainModelCommandHandler : CreateDomainModelCommandHandler
where TIdentifier : IComparable, IComparable, IEquatable
- where TDomainModel : class, IDomainModel
+ where TDomainModel : class, IDomainModel, new()
where TDataAccessModel : class, IDataAccessModel, new()
where TCommand : class, ICreateDomainModelCommand
{
@@ -70,7 +70,7 @@ protected override void CreateDomainModel(TDomainModel model, IEnumerable(dataAccessModel);
- mediator.Process(dataAccessModelCommand);
+ _ = mediator.Process(dataAccessModelCommand);
}
///
diff --git a/src/RapidField.SolidInstruments.DataAccess/DeleteDomainModelCommandHandler.cs b/src/RapidField.SolidInstruments.DataAccess/DeleteDomainModelCommandHandler.cs
index fcb957f9..33cc5f60 100644
--- a/src/RapidField.SolidInstruments.DataAccess/DeleteDomainModelCommandHandler.cs
+++ b/src/RapidField.SolidInstruments.DataAccess/DeleteDomainModelCommandHandler.cs
@@ -27,7 +27,7 @@ namespace RapidField.SolidInstruments.DataAccess
///
public class DeleteDomainModelCommandHandler