From 1cca248290c6ea9a68447ffca6f6d89ff0ca3784 Mon Sep 17 00:00:00 2001 From: adamjstone <8525409+adamjstone@users.noreply.github.com> Date: Tue, 25 Aug 2020 23:53:46 -0500 Subject: [PATCH] #371 Introduce user role example models. --- .editorconfig | 3 + RapidField.SolidInstruments.sln | 9 +- ....SolidInstruments.Messaging.Autofac.Rmq.md | 2 +- ...dInstruments.Messaging.DotNetNative.Rmq.md | 2 +- .../ApplicationDependencyPackage.cs | 43 +++++ .../ApplicationServiceExecutor.cs | 64 +++++++ .../Program.cs | 26 +++ ...idInstruments.Example.BeaconService.csproj | 42 ++++ .../appsettings.json | 15 ++ .../ApplicationServiceExecutor.cs | 38 +++- ...xample.Domain.AccessControl.Service.csproj | 12 +- .../CreateDomainModelCommandHandler.cs | 42 ++++ .../DeleteDomainModelCommandHandler.cs | 42 ++++ .../UpdateDomainModelCommandHandler.cs | 42 ++++ .../DatabaseContext.cs | 11 ++ .../DatabaseContextDependencyModule.cs | 5 +- .../DatabaseContextRepositoryFactory.cs | 4 +- .../DomainModelCreatedEventHandler.cs | 64 +++++++ .../DomainModelDeletedEventHandler.cs | 64 +++++++ .../DomainModelUpdatedEventHandler.cs | 64 +++++++ ...uments.Example.Domain.AccessControl.csproj | 4 + .../Repositories/UserRoleRepository.cs | 32 ++++ .../User/CreateDomainModelCommand.cs | 2 +- .../User/DeleteDomainModelCommand.cs | 2 +- .../User/UpdateDomainModelCommand.cs | 2 +- .../UserRole/CreateDomainModelCommand.cs | 129 +++++++++++++ .../UserRole/DeleteDomainModelCommand.cs | 129 +++++++++++++ .../UserRole/UpdateDomainModelCommand.cs | 129 +++++++++++++ .../User/DomainModelCreatedEvent.cs | 2 +- .../User/DomainModelDeletedEvent.cs | 2 +- .../User/DomainModelUpdatedEvent.cs | 2 +- .../UserRole/DomainModelCreatedEvent.cs | 180 ++++++++++++++++++ .../UserRole/DomainModelDeletedEvent.cs | 180 ++++++++++++++++++ .../UserRole/DomainModelUpdatedEvent.cs | 180 ++++++++++++++++++ .../MessageHandlerModule.cs | 18 ++ .../User/CreateDomainModelCommandMessage.cs | 2 +- .../User/DeleteDomainModelCommandMessage.cs | 2 +- .../User/UpdateDomainModelCommandMessage.cs | 2 +- .../CreateDomainModelCommandMessage.cs | 53 ++++++ .../DeleteDomainModelCommandMessage.cs | 53 ++++++ .../UpdateDomainModelCommandMessage.cs | 53 ++++++ .../User/DomainModelCreatedEventMessage.cs | 2 +- .../User/DomainModelDeletedEventMessage.cs | 2 +- .../User/DomainModelUpdatedEventMessage.cs | 2 +- .../DomainModelCreatedEventMessage.cs | 51 +++++ .../DomainModelDeletedEventMessage.cs | 51 +++++ .../DomainModelUpdatedEventMessage.cs | 51 +++++ .../Models/User/AggregateDataAccessModel.cs | 5 +- .../Models/User/DomainModel.cs | 40 +++- .../Models/User/IAggregateDomainModel.cs | 9 + .../Models/User/ValueDataAccessModel.cs | 4 +- .../UserRole/AggregateDataAccessModel.cs | 40 ++++ .../Models/UserRole/DomainModel.cs | 149 +++++++++++++++ .../Models/UserRole/IAggregateDomainModel.cs | 52 +++++ .../UserRole/IAggregateModel.cs} | 13 +- .../Models/UserRole/IValueDomainModel.cs | 15 ++ .../Models/UserRole/IValueModel.cs.cs | 31 +++ .../Models/UserRole/ValueDataAccessModel.cs | 70 +++++++ ...eld.SolidInstruments.Example.Domain.csproj | 8 + .../UserRole/AggregateModelRepository.cs | 37 ++++ .../UserRole/ValueModelRepository.cs | 37 ++++ .../Command.cs | 12 ++ .../CommandHandler.cs | 8 + .../CreateDomainModelCommand.cs | 6 + .../DeleteDomainModelCommand.cs | 6 + .../UpdateDomainModelCommand.cs | 6 + .../DateTimeRange.cs | 19 ++ .../Extensions/ByteCollectionExtensions.cs | 5 + .../Instrument.cs | 3 + .../SecureMemory.cs | 7 + ...teOrUpdateDataAccessModelCommandHandler.cs | 4 + .../DataAccessCommandHandler.cs | 8 + .../DataAccessModelCommandHandler.cs | 8 + .../DomainModelAssociatedEvent.cs | 6 + .../DomainModelCreatedEvent.cs | 6 + .../DomainModelDeletedEvent.cs | 6 + .../DomainModelUpdatedEvent.cs | 6 + .../Event.cs | 6 + .../Service/AutofacBeaconServiceExecutor.cs | 173 +++++++++++++++++ .../DotNetNativeBeaconServiceExecutor.cs | 173 +++++++++++++++++ .../Message.cs | 6 + .../Service/HeartbeatMessageListener.cs | 24 +++ 82 files changed, 2878 insertions(+), 41 deletions(-) create mode 100644 example/RapidField.SolidInstruments.Example.BeaconService/ApplicationDependencyPackage.cs create mode 100644 example/RapidField.SolidInstruments.Example.BeaconService/ApplicationServiceExecutor.cs create mode 100644 example/RapidField.SolidInstruments.Example.BeaconService/Program.cs create mode 100644 example/RapidField.SolidInstruments.Example.BeaconService/RapidField.SolidInstruments.Example.BeaconService.csproj create mode 100644 example/RapidField.SolidInstruments.Example.BeaconService/appsettings.json create mode 100644 example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/CreateDomainModelCommandHandler.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/DeleteDomainModelCommandHandler.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/UpdateDomainModelCommandHandler.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelCreatedEventHandler.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelDeletedEventHandler.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelUpdatedEventHandler.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain.AccessControl/Repositories/UserRoleRepository.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/CreateDomainModelCommand.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/DeleteDomainModelCommand.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/UpdateDomainModelCommand.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/DomainModelCreatedEvent.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/DomainModelDeletedEvent.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/DomainModelUpdatedEvent.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/CreateDomainModelCommandMessage.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/DeleteDomainModelCommandMessage.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/UpdateDomainModelCommandMessage.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/DomainModelCreatedEventMessage.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/DomainModelDeletedEventMessage.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/DomainModelUpdatedEventMessage.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/AggregateDataAccessModel.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/DomainModel.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IAggregateDomainModel.cs rename example/RapidField.SolidInstruments.Example.Domain/{AssemblyAttributes.cs => Models/UserRole/IAggregateModel.cs} (63%) create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IValueDomainModel.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IValueModel.cs.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/ValueDataAccessModel.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Repositories/UserRole/AggregateModelRepository.cs create mode 100644 example/RapidField.SolidInstruments.Example.Domain/Repositories/UserRole/ValueModelRepository.cs create mode 100644 src/RapidField.SolidInstruments.Messaging.Autofac/Service/AutofacBeaconServiceExecutor.cs create mode 100644 src/RapidField.SolidInstruments.Messaging.DotNetNative/Service/DotNetNativeBeaconServiceExecutor.cs diff --git a/.editorconfig b/.editorconfig index 50a8ac8e..7e09a963 100644 --- a/.editorconfig +++ b/.editorconfig @@ -230,6 +230,9 @@ dotnet_diagnostic.CA1027.severity = silent # CA1031: Do not catch general exception types dotnet_diagnostic.CA1031.severity = silent +# CA1034: Nested types should not be visible +dotnet_diagnostic.CA1034.severity = silent + # IDE0075: Simplify conditional expression dotnet_style_prefer_simplified_boolean_expressions = false : none diff --git a/RapidField.SolidInstruments.sln b/RapidField.SolidInstruments.sln index 940b0afa..a61a4743 100644 --- a/RapidField.SolidInstruments.sln +++ b/RapidField.SolidInstruments.sln @@ -401,7 +401,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RapidField.SolidInstruments EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RapidField.SolidInstruments.Example.Domain.AccessControl", "example\RapidField.SolidInstruments.Example.Domain.AccessControl\RapidField.SolidInstruments.Example.Domain.AccessControl.csproj", "{7B185E3A-3A26-4188-9FB4-DED7E4EF5C3D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RapidField.SolidInstruments.Example.Domain.AccessControl.Service", "example\RapidField.SolidInstruments.Example.Domain.AccessControl.Service\RapidField.SolidInstruments.Example.Domain.AccessControl.Service.csproj", "{77026FD0-F0DC-48B8-A678-0E67BDCC29EB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RapidField.SolidInstruments.Example.Domain.AccessControl.Service", "example\RapidField.SolidInstruments.Example.Domain.AccessControl.Service\RapidField.SolidInstruments.Example.Domain.AccessControl.Service.csproj", "{77026FD0-F0DC-48B8-A678-0E67BDCC29EB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RapidField.SolidInstruments.Example.BeaconService", "example\RapidField.SolidInstruments.Example.BeaconService\RapidField.SolidInstruments.Example.BeaconService.csproj", "{423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -625,6 +627,10 @@ Global {77026FD0-F0DC-48B8-A678-0E67BDCC29EB}.Debug|Any CPU.Build.0 = Debug|Any CPU {77026FD0-F0DC-48B8-A678-0E67BDCC29EB}.Release|Any CPU.ActiveCfg = Release|Any CPU {77026FD0-F0DC-48B8-A678-0E67BDCC29EB}.Release|Any CPU.Build.0 = Release|Any CPU + {423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {423CCBD1-0299-4C1A-BFDB-05AF2BF4847A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -700,6 +706,7 @@ Global {F20759D5-D39D-4C31-8A23-AEAA606776E6} = {F58E05BE-9DC6-41B4-8324-C006F6CE7CC7} {7B185E3A-3A26-4188-9FB4-DED7E4EF5C3D} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34} {77026FD0-F0DC-48B8-A678-0E67BDCC29EB} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34} + {423CCBD1-0299-4C1A-BFDB-05AF2BF4847A} = {BEB60D41-11BB-4C6E-8F5D-1E7990A27C34} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {834FCFB0-DA00-4ABD-9424-6FE1398A9F6E} diff --git a/doc/namespaces/RapidField.SolidInstruments.Messaging.Autofac.Rmq.md b/doc/namespaces/RapidField.SolidInstruments.Messaging.Autofac.Rmq.md index f94fff60..c9c3c576 100644 --- a/doc/namespaces/RapidField.SolidInstruments.Messaging.Autofac.Rmq.md +++ b/doc/namespaces/RapidField.SolidInstruments.Messaging.Autofac.Rmq.md @@ -32,7 +32,7 @@ Install-Package RapidField.SolidInstruments.Messaging.Autofac.Rmq ### Namespaces -#### [RapidField.SolidInstruments.Messaging.Autofac.Asb.Extensions](https://www.solidinstruments.com/api/RapidField.SolidInstruments.Messaging.Autofac.Asb.Extensions.html) +#### [RapidField.SolidInstruments.Messaging.Autofac.Rmq.Extensions](https://www.solidinstruments.com/api/RapidField.SolidInstruments.Messaging.Autofac.Rmq.Extensions.html)
Exposes extensions that support the Autofac IoC integration for the Solid Instruments RabbitMQ messaging abstractions. diff --git a/doc/namespaces/RapidField.SolidInstruments.Messaging.DotNetNative.Rmq.md b/doc/namespaces/RapidField.SolidInstruments.Messaging.DotNetNative.Rmq.md index 534d976e..63c5466a 100644 --- a/doc/namespaces/RapidField.SolidInstruments.Messaging.DotNetNative.Rmq.md +++ b/doc/namespaces/RapidField.SolidInstruments.Messaging.DotNetNative.Rmq.md @@ -32,7 +32,7 @@ Install-Package RapidField.SolidInstruments.Messaging.DotNetNative.Rmq ### Namespaces -#### [RapidField.SolidInstruments.Messaging.DotNetNative.Asb.Extensions](https://www.solidinstruments.com/api/RapidField.SolidInstruments.Messaging.DotNetNative.Asb.Extensions.html) +#### [RapidField.SolidInstruments.Messaging.DotNetNative.Rmq.Extensions](https://www.solidinstruments.com/api/RapidField.SolidInstruments.Messaging.DotNetNative.Rmq.Extensions.html)
Exposes extensions that support the DotNetNative IoC integration for the Solid Instruments RabbitMQ messaging abstractions. diff --git a/example/RapidField.SolidInstruments.Example.BeaconService/ApplicationDependencyPackage.cs b/example/RapidField.SolidInstruments.Example.BeaconService/ApplicationDependencyPackage.cs new file mode 100644 index 00000000..81357a3a --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.BeaconService/ApplicationDependencyPackage.cs @@ -0,0 +1,43 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using RapidField.SolidInstruments.Example.Domain; +using RapidField.SolidInstruments.InversionOfControl; +using RapidField.SolidInstruments.InversionOfControl.DotNetNative; +using System.Collections.Generic; + +namespace RapidField.SolidInstruments.Example.BeaconService +{ + /// + /// Encapsulates container configuration for the application. + /// + public class ApplicationDependencyPackage : DotNetNativeDependencyPackage + { + /// + /// Initializes a new instance of the class. + /// + public ApplicationDependencyPackage() + : base() + { + return; + } + + /// + /// Creates a new collection of dependency modules for the package. + /// + /// + /// Configuration information for the application. + /// + /// + /// The package's dependency modules. + /// + protected override IEnumerable> CreateModules(IConfiguration applicationConfiguration) => new IDependencyModule[] + { + new ServiceBusDependencyModule(applicationConfiguration), + new MessageHandlerModule(applicationConfiguration) + }; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.BeaconService/ApplicationServiceExecutor.cs b/example/RapidField.SolidInstruments.Example.BeaconService/ApplicationServiceExecutor.cs new file mode 100644 index 00000000..6f6628de --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.BeaconService/ApplicationServiceExecutor.cs @@ -0,0 +1,64 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using Microsoft.Extensions.Configuration; +using RapidField.SolidInstruments.Messaging.DotNetNative.Service; +using System; +using System.IO; + +namespace RapidField.SolidInstruments.Example.BeaconService +{ + /// + /// Prepares for and performs execution of the beacon service. + /// + public sealed class ApplicationServiceExecutor : DotNetNativeBeaconServiceExecutor + { + /// + /// Initializes a new instance of the class. + /// + public ApplicationServiceExecutor() + : base(true, false, false, false, false) + { + return; + } + + /// + /// Builds the application configuration for the service. + /// + /// + /// An object that is used to build the configuration. + /// + protected override void BuildConfiguration(IConfigurationBuilder configurationBuilder) + { + try + { + configurationBuilder.SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json"); + } + finally + { + base.BuildConfiguration(configurationBuilder); + } + } + + /// + /// Releases all resources consumed by the current . + /// + /// + /// A value indicating whether or not managed resources should be released. + /// + protected override void Dispose(Boolean disposing) => base.Dispose(disposing); + + /// + /// When overridden by a derived class, gets a copyright notice which is written to the console at the start of service + /// execution. + /// + protected override sealed String CopyrightNotice => "Copyright (c) RapidField LLC. All rights reserved."; + + /// + /// When overridden by a derived class, gets a product name associated with the service which is written to the console at + /// the start of service execution. + /// + protected override sealed String ProductName => "Solid Instruments"; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.BeaconService/Program.cs b/example/RapidField.SolidInstruments.Example.BeaconService/Program.cs new file mode 100644 index 00000000..ce344b3c --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.BeaconService/Program.cs @@ -0,0 +1,26 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using System; + +namespace RapidField.SolidInstruments.Example.BeaconService +{ + /// + /// Houses the entry point for the application. + /// + public static class Program + { + /// + /// Begins execution of the application. + /// + /// + /// Command line arguments that are provided at runtime. + /// + public static void Main(String[] args) + { + using var serviceExecutor = new ApplicationServiceExecutor(); + serviceExecutor.Execute(args); + } + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.BeaconService/RapidField.SolidInstruments.Example.BeaconService.csproj b/example/RapidField.SolidInstruments.Example.BeaconService/RapidField.SolidInstruments.Example.BeaconService.csproj new file mode 100644 index 00000000..b0180320 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.BeaconService/RapidField.SolidInstruments.Example.BeaconService.csproj @@ -0,0 +1,42 @@ + + + + + Solid Instruments contributors + RapidField + Copyright (c) RapidField LLC. All rights reserved. + Solid Instruments + This project demonstrates a beacon service application utilizing Solid Instruments constructs. + $(BuildVersion) + Exe + netcoreapp3.1 + latest + + + bin\Debug\netcoreapp3.1\RapidField.SolidInstruments.Example.BeaconService.xml + true + + + + bin\Release\netcoreapp3.1\RapidField.SolidInstruments.Example.BeaconService.xml + true + + + + + + + + + PreserveNewest + + + + + + + + + \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.BeaconService/appsettings.json b/example/RapidField.SolidInstruments.Example.BeaconService/appsettings.json new file mode 100644 index 00000000..87260103 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.BeaconService/appsettings.json @@ -0,0 +1,15 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +{ + "ConnectionStrings": { + "ExampleServiceBus": "amqp://guest:guest@localhost:5672" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Warning" + } + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service/ApplicationServiceExecutor.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service/ApplicationServiceExecutor.cs index a59aaacb..b190bbf3 100644 --- a/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service/ApplicationServiceExecutor.cs +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service/ApplicationServiceExecutor.cs @@ -62,11 +62,17 @@ protected override void AddListeners(IMessageListeningProfile listeningProfile, listeningProfile.AddCommandListener(); listeningProfile.AddCommandListener(); listeningProfile.AddCommandListener(); + listeningProfile.AddCommandListener(); + listeningProfile.AddCommandListener(); + listeningProfile.AddCommandListener(); // Add event listeners. listeningProfile.AddEventListener(); listeningProfile.AddEventListener(); listeningProfile.AddEventListener(); + listeningProfile.AddEventListener(); + listeningProfile.AddEventListener(); + listeningProfile.AddEventListener(); } finally { @@ -116,11 +122,37 @@ protected override void OnExecutionStarting(IDependencyScope dependencyScope, IC { try { + var mediator = dependencyScope.Resolve(); + + // Create or update the database schema. var databaseContext = dependencyScope.Resolve(); databaseContext.Database.EnsureCreated(); - var mediator = dependencyScope.Resolve(); - mediator.Process(new Messages.Command.ModelState.User.CreateDomainModelCommandMessage(new Commands.ModelState.User.CreateDomainModelCommand(Models.User.DomainModel.Named.StevenCallahan))); - mediator.Process(new Messages.Command.ModelState.User.CreateDomainModelCommandMessage(new Commands.ModelState.User.CreateDomainModelCommand(Models.User.DomainModel.Named.TomSmith))); + + foreach (var domainModel in Models.User.DomainModel.Named.All()) + { + mediator.Process(new Messages.Command.ModelState.User.CreateDomainModelCommandMessage(new Commands.ModelState.User.CreateDomainModelCommand(domainModel))); + } + + foreach (var domainModel in Models.UserRole.DomainModel.Named.All()) + { + mediator.Process(new Messages.Command.ModelState.UserRole.CreateDomainModelCommandMessage(new Commands.ModelState.UserRole.CreateDomainModelCommand(domainModel))); + } + + try + { + // Test service bus connectivity. + var pingRequestCorrelationIdentifier = Guid.NewGuid(); + var pingResponseMessage = mediator.Process(new PingRequestMessage(pingRequestCorrelationIdentifier)); + + if (pingResponseMessage is null || pingResponseMessage.CorrelationIdentifier != pingRequestCorrelationIdentifier) + { + throw new ServiceExectuionException("The service was unable to verify service bus connectivity."); + } + } + catch (CommandHandlingException exception) + { + throw new ServiceExectuionException("The service was unable to verify service bus connectivity. See inner exception.", exception); + } } finally { diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service/RapidField.SolidInstruments.Example.Domain.AccessControl.Service.csproj b/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service/RapidField.SolidInstruments.Example.Domain.AccessControl.Service.csproj index 85efa36a..a0a333fd 100644 --- a/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service/RapidField.SolidInstruments.Example.Domain.AccessControl.Service.csproj +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl.Service/RapidField.SolidInstruments.Example.Domain.AccessControl.Service.csproj @@ -15,28 +15,28 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in latest - bin\Debug\netstandard2.1\RapidField.SolidInstruments.Example.Domain.AccessControl.Service.xml + bin\Debug\netcoreapp3.1\RapidField.SolidInstruments.Example.Domain.AccessControl.Service.xml true - bin\Release\netstandard2.1\RapidField.SolidInstruments.Example.Domain.AccessControl.Service.xml + bin\Release\netcoreapp3.1\RapidField.SolidInstruments.Example.Domain.AccessControl.Service.xml true - + - PreserveNewest + PreserveNewest - + - + \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/CreateDomainModelCommandHandler.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/CreateDomainModelCommandHandler.cs new file mode 100644 index 00000000..70d9af89 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/CreateDomainModelCommandHandler.cs @@ -0,0 +1,42 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using RapidField.SolidInstruments.Command; +using RapidField.SolidInstruments.DataAccess; +using System; +using DataAccessModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.AggregateDataAccessModel; +using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; +using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.UserRole.CreateDomainModelCommand; + +namespace RapidField.SolidInstruments.Example.Domain.AccessControl.CommandHandlers.ModelState.UserRole +{ + /// + /// Processes a single . + /// + public sealed class CreateDomainModelCommandHandler : CreateDomainModelCommandHandler + { + /// + /// Initializes a new instance of the class. + /// + /// + /// A processing intermediary that is used to process sub-commands. + /// + /// + /// is . + /// + public CreateDomainModelCommandHandler(ICommandMediator mediator) + : base(mediator) + { + return; + } + + /// + /// Releases all resources consumed by the current . + /// + /// + /// A value indicating whether or not managed resources should be released. + /// + protected override void Dispose(Boolean disposing) => base.Dispose(disposing); + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/DeleteDomainModelCommandHandler.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/DeleteDomainModelCommandHandler.cs new file mode 100644 index 00000000..74508ae2 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/DeleteDomainModelCommandHandler.cs @@ -0,0 +1,42 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using RapidField.SolidInstruments.Command; +using RapidField.SolidInstruments.DataAccess; +using System; +using DataAccessModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.AggregateDataAccessModel; +using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; +using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.UserRole.DeleteDomainModelCommand; + +namespace RapidField.SolidInstruments.Example.Domain.AccessControl.CommandHandlers.ModelState.UserRole +{ + /// + /// Processes a single . + /// + public sealed class DeleteDomainModelCommandHandler : DeleteDomainModelCommandHandler + { + /// + /// Initializes a new instance of the class. + /// + /// + /// A processing intermediary that is used to process sub-commands. + /// + /// + /// is . + /// + public DeleteDomainModelCommandHandler(ICommandMediator mediator) + : base(mediator) + { + return; + } + + /// + /// Releases all resources consumed by the current . + /// + /// + /// A value indicating whether or not managed resources should be released. + /// + protected override void Dispose(Boolean disposing) => base.Dispose(disposing); + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/UpdateDomainModelCommandHandler.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/UpdateDomainModelCommandHandler.cs new file mode 100644 index 00000000..c183a06c --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlers/ModelState/UserRole/UpdateDomainModelCommandHandler.cs @@ -0,0 +1,42 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using RapidField.SolidInstruments.Command; +using RapidField.SolidInstruments.DataAccess; +using System; +using DataAccessModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.AggregateDataAccessModel; +using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; +using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.UserRole.UpdateDomainModelCommand; + +namespace RapidField.SolidInstruments.Example.Domain.AccessControl.CommandHandlers.ModelState.UserRole +{ + /// + /// Processes a single . + /// + public sealed class UpdateDomainModelCommandHandler : UpdateDomainModelCommandHandler + { + /// + /// Initializes a new instance of the class. + /// + /// + /// A processing intermediary that is used to process sub-commands. + /// + /// + /// is . + /// + public UpdateDomainModelCommandHandler(ICommandMediator mediator) + : base(mediator) + { + return; + } + + /// + /// Releases all resources consumed by the current . + /// + /// + /// A value indicating whether or not managed resources should be released. + /// + protected override void Dispose(Boolean disposing) => base.Dispose(disposing); + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContext.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContext.cs index e860145f..b2d6ba70 100644 --- a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContext.cs +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContext.cs @@ -9,6 +9,7 @@ using System.Configuration; using System.Diagnostics; using UserModel = RapidField.SolidInstruments.Example.Domain.Models.User.AggregateDataAccessModel; +using UserRoleModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.AggregateDataAccessModel; namespace RapidField.SolidInstruments.Example.Domain.AccessControl { @@ -50,6 +51,7 @@ protected override void OnModelCreating(IConfiguration applicationConfiguration, try { _ = modelBuilder.Entity(); + _ = modelBuilder.Entity(); } finally { @@ -57,6 +59,15 @@ protected override void OnModelCreating(IConfiguration applicationConfiguration, } } + /// + /// Gets or sets a persistent collection of records. + /// + public DbSet UserRoles + { + get; + set; + } + /// /// Gets or sets a persistent collection of records. /// diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContextDependencyModule.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContextDependencyModule.cs index 5463df10..f392a553 100644 --- a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContextDependencyModule.cs +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContextDependencyModule.cs @@ -9,6 +9,7 @@ using RapidField.SolidInstruments.Example.Domain.AccessControl.Repositories; using System; using UserModel = RapidField.SolidInstruments.Example.Domain.Models.User.AggregateDataAccessModel; +using UserRoleModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.AggregateDataAccessModel; namespace RapidField.SolidInstruments.Example.Domain.AccessControl { @@ -41,6 +42,8 @@ public DatabaseContextDependencyModule(IConfiguration applicationConfiguration) /// /// Configuration information for the application. /// - protected override void RegisterCustomComponents(ServiceCollection configurator, IConfiguration applicationConfiguration) => _ = configurator.AddStandardDataAccessModelCommandHandlers(); + protected override void RegisterCustomComponents(ServiceCollection configurator, IConfiguration applicationConfiguration) => _ = configurator + .AddStandardDataAccessModelCommandHandlers() + .AddStandardDataAccessModelCommandHandlers(); } } \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContextRepositoryFactory.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContextRepositoryFactory.cs index 9752bdd2..f5a4d2c3 100644 --- a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContextRepositoryFactory.cs +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/DatabaseContextRepositoryFactory.cs @@ -44,7 +44,9 @@ public DatabaseContextRepositoryFactory(DatabaseContext context, IConfiguration /// /// The database session that is used by the produced repositories. /// - protected override void Configure(ObjectFactoryConfiguration configuration, DatabaseContext context) => configuration.ProductionFunctions.Add(() => new UserRepository(context)); + protected override void Configure(ObjectFactoryConfiguration configuration, DatabaseContext context) => configuration.ProductionFunctions + .Add(() => new UserRepository(context)) + .Add(() => new UserRoleRepository(context)); /// /// Releases all resources consumed by the current . diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelCreatedEventHandler.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelCreatedEventHandler.cs new file mode 100644 index 00000000..4ad8c129 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelCreatedEventHandler.cs @@ -0,0 +1,64 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using RapidField.SolidInstruments.Command; +using RapidField.SolidInstruments.Core.Concurrency; +using RapidField.SolidInstruments.Core.Extensions; +using RapidField.SolidInstruments.EventAuthoring; +using System; +using System.Collections.Generic; +using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; +using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelCreatedEvent; + +namespace RapidField.SolidInstruments.Example.Domain.AccessControl.EventHandlers.ModelState.UserRole +{ + /// + /// Processes a single . + /// + public sealed class DomainModelCreatedEventHandler : DomainModelCreatedEventHandler + { + /// + /// Initializes a new instance of the class. + /// + /// + /// A processing intermediary that is used to process sub-commands. + /// + /// + /// is . + /// + public DomainModelCreatedEventHandler(ICommandMediator mediator) + : base(mediator) + { + return; + } + + /// + /// Releases all resources consumed by the current . + /// + /// + /// A value indicating whether or not managed resources should be released. + /// + protected override void Dispose(Boolean disposing) => base.Dispose(disposing); + + /// + /// Processes the specified domain model. + /// + /// + /// The model that was created. + /// + /// + /// A collection of textual labels that provide categorical and/or contextual information about the event. + /// + /// + /// A unique identifier to assign to sub-commands. + /// + /// + /// A processing intermediary that is used to process sub-commands. + /// + /// + /// A token that represents and manages contextual thread safety. + /// + protected override void Process(DomainModel model, IEnumerable labels, Guid correlationIdentifier, ICommandMediator mediator, IConcurrencyControlToken controlToken) => Console.WriteLine($"A user role was created (identifier: {model?.Identifier.ToSerializedString()})."); + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelDeletedEventHandler.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelDeletedEventHandler.cs new file mode 100644 index 00000000..3cdb498c --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelDeletedEventHandler.cs @@ -0,0 +1,64 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using RapidField.SolidInstruments.Command; +using RapidField.SolidInstruments.Core.Concurrency; +using RapidField.SolidInstruments.Core.Extensions; +using RapidField.SolidInstruments.EventAuthoring; +using System; +using System.Collections.Generic; +using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; +using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelDeletedEvent; + +namespace RapidField.SolidInstruments.Example.Domain.AccessControl.EventHandlers.ModelState.UserRole +{ + /// + /// Processes a single . + /// + public sealed class DomainModelDeletedEventHandler : DomainModelDeletedEventHandler + { + /// + /// Initializes a new instance of the class. + /// + /// + /// A processing intermediary that is used to process sub-commands. + /// + /// + /// is . + /// + public DomainModelDeletedEventHandler(ICommandMediator mediator) + : base(mediator) + { + return; + } + + /// + /// Releases all resources consumed by the current . + /// + /// + /// A value indicating whether or not managed resources should be released. + /// + protected override void Dispose(Boolean disposing) => base.Dispose(disposing); + + /// + /// Processes the specified domain model. + /// + /// + /// The model that was created. + /// + /// + /// A collection of textual labels that provide categorical and/or contextual information about the event. + /// + /// + /// A unique identifier to assign to sub-commands. + /// + /// + /// A processing intermediary that is used to process sub-commands. + /// + /// + /// A token that represents and manages contextual thread safety. + /// + protected override void Process(DomainModel model, IEnumerable labels, Guid correlationIdentifier, ICommandMediator mediator, IConcurrencyControlToken controlToken) => Console.WriteLine($"A user role was deleted (identifier: {model?.Identifier.ToSerializedString()})."); + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelUpdatedEventHandler.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelUpdatedEventHandler.cs new file mode 100644 index 00000000..1d390fce --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlers/ModelState/UserRole/DomainModelUpdatedEventHandler.cs @@ -0,0 +1,64 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using RapidField.SolidInstruments.Command; +using RapidField.SolidInstruments.Core.Concurrency; +using RapidField.SolidInstruments.Core.Extensions; +using RapidField.SolidInstruments.EventAuthoring; +using System; +using System.Collections.Generic; +using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; +using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelUpdatedEvent; + +namespace RapidField.SolidInstruments.Example.Domain.AccessControl.EventHandlers.ModelState.UserRole +{ + /// + /// Processes a single . + /// + public sealed class DomainModelUpdatedEventHandler : DomainModelUpdatedEventHandler + { + /// + /// Initializes a new instance of the class. + /// + /// + /// A processing intermediary that is used to process sub-commands. + /// + /// + /// is . + /// + public DomainModelUpdatedEventHandler(ICommandMediator mediator) + : base(mediator) + { + return; + } + + /// + /// Releases all resources consumed by the current . + /// + /// + /// A value indicating whether or not managed resources should be released. + /// + protected override void Dispose(Boolean disposing) => base.Dispose(disposing); + + /// + /// Processes the specified domain model. + /// + /// + /// The model that was created. + /// + /// + /// A collection of textual labels that provide categorical and/or contextual information about the event. + /// + /// + /// A unique identifier to assign to sub-commands. + /// + /// + /// A processing intermediary that is used to process sub-commands. + /// + /// + /// A token that represents and manages contextual thread safety. + /// + protected override void Process(DomainModel model, IEnumerable labels, Guid correlationIdentifier, ICommandMediator mediator, IConcurrencyControlToken controlToken) => Console.WriteLine($"A user role was updated (identifier: {model?.Identifier.ToSerializedString()})."); + } +} \ 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 index 81c381fb..c6c75b7b 100644 --- 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 @@ -32,4 +32,8 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in + + + + \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain.AccessControl/Repositories/UserRoleRepository.cs b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/Repositories/UserRoleRepository.cs new file mode 100644 index 00000000..32528b31 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain.AccessControl/Repositories/UserRoleRepository.cs @@ -0,0 +1,32 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using System; +using DataAccessModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.AggregateDataAccessModel; + +namespace RapidField.SolidInstruments.Example.Domain.AccessControl.Repositories +{ + using BaseRepository = Domain.Repositories.UserRole.AggregateModelRepository; + + /// + /// Performs data access operations for the type. + /// + public sealed class UserRoleRepository : BaseRepository + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The database session for the repository. + /// + /// + /// is . + /// + public UserRoleRepository(DatabaseContext context) + : base(context) + { + return; + } + } +} \ 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 index 706d530e..9cbee967 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/CreateDomainModelCommand.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/CreateDomainModelCommand.cs @@ -124,6 +124,6 @@ public CreateDomainModelCommand(DomainModel model, IEnumerable labels, G /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "CreateUserCommand"; + internal const String DataContractName = DataContractNameVerb + DomainModel.DataContractName + DataContractNameSuffix; } } \ 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 index 29d8e400..94cc4156 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/DeleteDomainModelCommand.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/DeleteDomainModelCommand.cs @@ -124,6 +124,6 @@ public DeleteDomainModelCommand(DomainModel model, IEnumerable labels, G /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "DeleteUserCommand"; + internal const String DataContractName = DataContractNameVerb + DomainModel.DataContractName + DataContractNameSuffix; } } \ 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 index 9154cdf1..a878f8f4 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/UpdateDomainModelCommand.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/User/UpdateDomainModelCommand.cs @@ -124,6 +124,6 @@ public UpdateDomainModelCommand(DomainModel model, IEnumerable labels, G /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "UpdateUserCommand"; + internal const String DataContractName = DataContractNameVerb + DomainModel.DataContractName + DataContractNameSuffix; } } \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/CreateDomainModelCommand.cs b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/CreateDomainModelCommand.cs new file mode 100644 index 00000000..f4d1e64e --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/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.UserRole.DomainModel; +using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelCreatedEvent; + +namespace RapidField.SolidInstruments.Example.Domain.Commands.ModelState.UserRole +{ + /// + /// 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)] + internal const String DataContractName = DataContractNameVerb + DomainModel.DataContractName + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/DeleteDomainModelCommand.cs b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/DeleteDomainModelCommand.cs new file mode 100644 index 00000000..14381a39 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/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.UserRole.DomainModel; +using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelDeletedEvent; + +namespace RapidField.SolidInstruments.Example.Domain.Commands.ModelState.UserRole +{ + /// + /// 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)] + internal const String DataContractName = DataContractNameVerb + DomainModel.DataContractName + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/UpdateDomainModelCommand.cs b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/UpdateDomainModelCommand.cs new file mode 100644 index 00000000..801160a4 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Commands/ModelState/UserRole/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.UserRole.DomainModel; +using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelUpdatedEvent; + +namespace RapidField.SolidInstruments.Example.Domain.Commands.ModelState.UserRole +{ + /// + /// 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)] + internal const String DataContractName = DataContractNameVerb + DomainModel.DataContractName + DataContractNameSuffix; + } +} \ 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 index 03d0038e..9e0468b8 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelCreatedEvent.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelCreatedEvent.cs @@ -175,6 +175,6 @@ public DomainModelCreatedEvent(DomainModel model, IEnumerable labels, Ev /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "UserCreatedEvent"; + internal const String DataContractName = DomainModel.DataContractName + DataContractNameVerb + DataContractNameSuffix; } } \ 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 index 5aef3b33..1ce4b893 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelDeletedEvent.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelDeletedEvent.cs @@ -175,6 +175,6 @@ public DomainModelDeletedEvent(DomainModel model, IEnumerable labels, Ev /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "UserDeletedEvent"; + internal const String DataContractName = DomainModel.DataContractName + DataContractNameVerb + DataContractNameSuffix; } } \ 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 index ab84c5d5..626e3e8b 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelUpdatedEvent.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/User/DomainModelUpdatedEvent.cs @@ -175,6 +175,6 @@ public DomainModelUpdatedEvent(DomainModel model, IEnumerable labels, Ev /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "UserUpdatedEvent"; + internal const String DataContractName = DomainModel.DataContractName + DataContractNameVerb + DataContractNameSuffix; } } \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/DomainModelCreatedEvent.cs b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/DomainModelCreatedEvent.cs new file mode 100644 index 00000000..5d7717c9 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/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.UserRole.DomainModel; + +namespace RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole +{ + /// + /// 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)] + internal const String DataContractName = DomainModel.DataContractName + DataContractNameVerb + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/DomainModelDeletedEvent.cs b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/DomainModelDeletedEvent.cs new file mode 100644 index 00000000..20738434 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/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.UserRole.DomainModel; + +namespace RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole +{ + /// + /// 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)] + internal const String DataContractName = DomainModel.DataContractName + DataContractNameVerb + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/DomainModelUpdatedEvent.cs b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/DomainModelUpdatedEvent.cs new file mode 100644 index 00000000..db86b5e4 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Events/ModelState/UserRole/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.UserRole.DomainModel; + +namespace RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole +{ + /// + /// 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)] + internal const String DataContractName = DomainModel.DataContractName + DataContractNameVerb + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/MessageHandlerModule.cs b/example/RapidField.SolidInstruments.Example.Domain/MessageHandlerModule.cs index 6c942775..31bdcd40 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/MessageHandlerModule.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/MessageHandlerModule.cs @@ -45,21 +45,39 @@ protected override void Configure(ServiceCollection configurator, IConfiguration configurator.AddCommandMessageListener(); configurator.AddCommandMessageListener(); configurator.AddCommandMessageListener(); + configurator.AddCommandMessageListener(); + configurator.AddCommandMessageListener(); + configurator.AddCommandMessageListener(); // Register command message transmitters. configurator.AddCommandMessageTransmitter(); configurator.AddCommandMessageTransmitter(); configurator.AddCommandMessageTransmitter(); + configurator.AddCommandMessageTransmitter(); + configurator.AddCommandMessageTransmitter(); + configurator.AddCommandMessageTransmitter(); // Register event message listeners. configurator.AddEventMessageListener(); configurator.AddEventMessageListener(); configurator.AddEventMessageListener(); + configurator.AddEventMessageListener(); + configurator.AddEventMessageListener(); + configurator.AddEventMessageListener(); // Register event message transmitters. configurator.AddEventMessageTransmitter(); configurator.AddEventMessageTransmitter(); configurator.AddEventMessageTransmitter(); + configurator.AddEventMessageTransmitter(); + configurator.AddEventMessageTransmitter(); + configurator.AddEventMessageTransmitter(); + + // Register request message listeners. + configurator.AddPingRequestMessageListener(); + + // Register request message transmitters. + configurator.AddPingRequestMessageTransmitter(); } } } \ 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 index 8b360061..46b76861 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/CreateDomainModelCommandMessage.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/CreateDomainModelCommandMessage.cs @@ -48,6 +48,6 @@ public CreateDomainModelCommandMessage(DomainModelCommand commandObject) /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "CreateUserCommandMessage"; + internal const String DataContractName = DomainModelCommand.DataContractName + DataContractNameSuffix; } } \ 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 index bc2f3839..63393b7f 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/DeleteDomainModelCommandMessage.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/DeleteDomainModelCommandMessage.cs @@ -48,6 +48,6 @@ public DeleteDomainModelCommandMessage(DomainModelCommand commandObject) /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "DeleteUserCommandMessage"; + internal const String DataContractName = DomainModelCommand.DataContractName + DataContractNameSuffix; } } \ 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 index 0fb32fff..92988d43 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/UpdateDomainModelCommandMessage.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/User/UpdateDomainModelCommandMessage.cs @@ -48,6 +48,6 @@ public UpdateDomainModelCommandMessage(DomainModelCommand commandObject) /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "UpdateUserCommandMessage"; + internal const String DataContractName = DomainModelCommand.DataContractName + DataContractNameSuffix; } } \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/CreateDomainModelCommandMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/CreateDomainModelCommandMessage.cs new file mode 100644 index 00000000..4d891a04 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/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.UserRole.DomainModel; +using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.UserRole.CreateDomainModelCommand; +using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelCreatedEvent; +using ReportedEventMessage = RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.UserRole.DomainModelCreatedEventMessage; + +namespace RapidField.SolidInstruments.Example.Domain.Messages.Command.ModelState.UserRole +{ + 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)] + internal const String DataContractName = DomainModelCommand.DataContractName + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/DeleteDomainModelCommandMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/DeleteDomainModelCommandMessage.cs new file mode 100644 index 00000000..13da24ee --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/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.UserRole.DomainModel; +using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.UserRole.DeleteDomainModelCommand; +using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelDeletedEvent; +using ReportedEventMessage = RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.UserRole.DomainModelDeletedEventMessage; + +namespace RapidField.SolidInstruments.Example.Domain.Messages.Command.ModelState.UserRole +{ + 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)] + internal const String DataContractName = DomainModelCommand.DataContractName + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/UpdateDomainModelCommandMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/UpdateDomainModelCommandMessage.cs new file mode 100644 index 00000000..e8febaf4 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Command/ModelState/UserRole/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.UserRole.DomainModel; +using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.UserRole.UpdateDomainModelCommand; +using ReportedEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelUpdatedEvent; +using ReportedEventMessage = RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.UserRole.DomainModelUpdatedEventMessage; + +namespace RapidField.SolidInstruments.Example.Domain.Messages.Command.ModelState.UserRole +{ + 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)] + internal const String DataContractName = DomainModelCommand.DataContractName + DataContractNameSuffix; + } +} \ 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 index 4fdd5f5b..415ad95d 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelCreatedEventMessage.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelCreatedEventMessage.cs @@ -46,6 +46,6 @@ public DomainModelCreatedEventMessage(DomainModelEvent eventObject) /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "UserCreatedEventMessage"; + internal const String DataContractName = DomainModelEvent.DataContractName + DataContractNameSuffix; } } \ 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 index 3f5c1a60..e7b182b8 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelDeletedEventMessage.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelDeletedEventMessage.cs @@ -46,6 +46,6 @@ public DomainModelDeletedEventMessage(DomainModelEvent eventObject) /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "UserDeletedEventMessage"; + internal const String DataContractName = DomainModelEvent.DataContractName + DataContractNameSuffix; } } \ 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 index 0d406009..ff56a75a 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelUpdatedEventMessage.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/User/DomainModelUpdatedEventMessage.cs @@ -46,6 +46,6 @@ public DomainModelUpdatedEventMessage(DomainModelEvent eventObject) /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private const String DataContractName = "UserUpdatedEventMessage"; + internal const String DataContractName = DomainModelEvent.DataContractName + DataContractNameSuffix; } } \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/DomainModelCreatedEventMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/DomainModelCreatedEventMessage.cs new file mode 100644 index 00000000..d21de446 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/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.UserRole.DomainModel; +using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelCreatedEvent; + +namespace RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.UserRole +{ + 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)] + internal const String DataContractName = DomainModelEvent.DataContractName + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/DomainModelDeletedEventMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/DomainModelDeletedEventMessage.cs new file mode 100644 index 00000000..68b40e4a --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/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.UserRole.DomainModel; +using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelDeletedEvent; + +namespace RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.UserRole +{ + 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)] + internal const String DataContractName = DomainModelEvent.DataContractName + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/DomainModelUpdatedEventMessage.cs b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/DomainModelUpdatedEventMessage.cs new file mode 100644 index 00000000..c24a0d8f --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Messages/Event/ModelState/UserRole/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.UserRole.DomainModel; +using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.UserRole.DomainModelUpdatedEvent; + +namespace RapidField.SolidInstruments.Example.Domain.Messages.Event.ModelState.UserRole +{ + 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)] + internal const String DataContractName = DomainModelEvent.DataContractName + DataContractNameSuffix; + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/AggregateDataAccessModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/AggregateDataAccessModel.cs index 28fa5328..ab9fe597 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Models/User/AggregateDataAccessModel.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/AggregateDataAccessModel.cs @@ -7,6 +7,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Diagnostics; using System.Runtime.Serialization; +using AssociatedDomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel; namespace RapidField.SolidInstruments.Example.Domain.Models.User { @@ -29,10 +30,10 @@ public AggregateDataAccessModel() /// /// Gets or sets the hashed password for the current . /// - [Column(Order = 3)] + [Column] [DataMember] [Required] - [StringLength(89)] + [StringLength(AssociatedDomainModel.PasswordHashValueMaximumLength)] public String PasswordHash { get; diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.cs index 7682b5c5..78c649f9 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/DomainModel.cs @@ -50,11 +50,14 @@ internal DomainModel(Guid identifier) /// /// is . /// + /// + /// is too long. + /// [DataMember] public String EmailAddress { get => EmailAddressValue; - set => EmailAddressValue = value.RejectIf().IsNullOrEmpty(nameof(EmailAddress)); + set => EmailAddressValue = value.RejectIf().IsNullOrEmpty(nameof(EmailAddress)).OrIf().LengthIsGreaterThan(EmailAddressValueMaximumLength, nameof(EmailAddress)); } /// @@ -66,11 +69,14 @@ public String EmailAddress /// /// is . /// + /// + /// is too long. + /// [DataMember] public String Name { get => NameValue; - set => NameValue = value.RejectIf().IsNullOrEmpty(nameof(Name)); + set => NameValue = value.RejectIf().IsNullOrEmpty(nameof(Name)).OrIf().LengthIsGreaterThan(EmailAddressValueMaximumLength, nameof(Name)); } /// @@ -82,18 +88,39 @@ public String Name /// /// is . /// + /// + /// is too long. + /// [DataMember] public String PasswordHash { get => PasswordHashValue; - set => PasswordHashValue = value.RejectIf().IsNullOrEmpty(nameof(PasswordHash)); + set => PasswordHashValue = value.RejectIf().IsNullOrEmpty(nameof(PasswordHash)).OrIf().LengthIsGreaterThan(PasswordHashValueMaximumLength, nameof(PasswordHash)); } /// /// Represents the name that is used when representing this type in serialization and transport contexts. /// [DebuggerBrowsable(DebuggerBrowsableState.Never)] - internal const String DataContractName = "User"; + internal const String DataContractName = nameof(User); + + /// + /// Represents the maximum email address string length for instances. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + internal const Int32 EmailAddressValueMaximumLength = 320; + + /// + /// Represents the maximum name string length for instances. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + internal const Int32 NameValueMaximumLength = 89; + + /// + /// Represents the maximum hashed password string length for instances. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + internal const Int32 PasswordHashValueMaximumLength = 89; /// /// Represents the email address for the current . @@ -119,7 +146,7 @@ public String PasswordHash /// /// Contains a collection of known instances. /// - internal static class Named + public static class Named { /// /// Returns a collection of all known instances. @@ -127,8 +154,7 @@ internal static class Named /// /// A collection of all known instances. /// - [DebuggerHidden] - internal static IEnumerable All() => new DomainModel[] + public static IEnumerable All() => new DomainModel[] { StevenCallahan, TomSmith diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/IAggregateDomainModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/IAggregateDomainModel.cs index 0ec25040..47505b49 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Models/User/IAggregateDomainModel.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/IAggregateDomainModel.cs @@ -22,6 +22,9 @@ public interface IAggregateDomainModel : IAggregateModel, IBaseDomainModel, IVal /// /// is . /// + /// + /// is too long. + /// public new String EmailAddress { get; @@ -37,6 +40,9 @@ public interface IAggregateDomainModel : IAggregateModel, IBaseDomainModel, IVal /// /// is . /// + /// + /// is too long. + /// public new String Name { get; @@ -52,6 +58,9 @@ public interface IAggregateDomainModel : IAggregateModel, IBaseDomainModel, IVal /// /// is . /// + /// + /// is too long. + /// public new String PasswordHash { get; diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/User/ValueDataAccessModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/User/ValueDataAccessModel.cs index e97f893a..ba877b6e 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/Models/User/ValueDataAccessModel.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/User/ValueDataAccessModel.cs @@ -35,7 +35,7 @@ public ValueDataAccessModel() [Column(Order = 1)] [DataMember] [Required] - [StringLength(320)] + [StringLength(AssociatedDomainModel.EmailAddressValueMaximumLength)] public String EmailAddress { get; @@ -48,7 +48,7 @@ public String EmailAddress [Column(Order = 2)] [DataMember] [Required] - [StringLength(89)] + [StringLength(AssociatedDomainModel.NameValueMaximumLength)] public String Name { get; diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/AggregateDataAccessModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/AggregateDataAccessModel.cs new file mode 100644 index 00000000..bea777f3 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/AggregateDataAccessModel.cs @@ -0,0 +1,40 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using System; +using System.ComponentModel.DataAnnotations.Schema; +using System.Diagnostics; +using System.Runtime.Serialization; + +namespace RapidField.SolidInstruments.Example.Domain.Models.UserRole +{ + /// + /// Represents a user role. + /// + [DataContract(Name = DataContractName)] + [Table(TableName)] + public sealed class AggregateDataAccessModel : ValueDataAccessModel, IAggregateModel + { + /// + /// Initializes a new instance of the class. + /// + public AggregateDataAccessModel() + : base() + { + return; + } + + /// + /// Represents the name that is used when representing this type as a database entity. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + internal new const String TableName = ValueDataAccessModel.TableName; + + /// + /// Represents the name that is used when representing this type in serialization and transport contexts. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private const String DataContractName = TableName + nameof(AggregateDataAccessModel); + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/DomainModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/DomainModel.cs new file mode 100644 index 00000000..c714c64f --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/DomainModel.cs @@ -0,0 +1,149 @@ +// ================================================================================================================================= +// 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 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.UserRole +{ + /// + /// Represents a user role. + /// + [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 description of the current . + /// + /// + /// is empty. + /// + /// + /// is . + /// + /// + /// is too long. + /// + [DataMember] + public String Description + { + get => DescriptionValue; + set => DescriptionValue = value.RejectIf().IsNullOrEmpty(nameof(Description)).OrIf().LengthIsGreaterThan(DescriptionValueMaximumLength, nameof(Description)); + } + + /// + /// Gets or sets the name of the current . + /// + /// + /// is empty. + /// + /// + /// is . + /// + /// + /// is too long. + /// + [DataMember] + public String Name + { + get => NameValue; + set => NameValue = value.RejectIf().IsNullOrEmpty(nameof(Name)).OrIf().LengthIsGreaterThan(NameValueMaximumLength, nameof(Name)); + } + + /// + /// Represents the name that is used when representing this type in serialization and transport contexts. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + internal const String DataContractName = nameof(UserRole); + + /// + /// Represents the maximum description string length for instances. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + internal const Int32 DescriptionValueMaximumLength = 89; + + /// + /// Represents the maximum name string length for instances. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + internal const Int32 NameValueMaximumLength = 55; + + /// + /// Represents the description for the current . + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [IgnoreDataMember] + private String DescriptionValue; + + /// + /// Represents the name of the current . + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + [IgnoreDataMember] + private String NameValue; + + /// + /// Contains a collection of known instances. + /// + public static class Named + { + /// + /// Returns a collection of all known instances. + /// + /// + /// A collection of all known instances. + /// + public static IEnumerable All() => new DomainModel[] + { + EndUser, + SystemAdministrator + }; + + /// + /// Gets the end user role. + /// + public static DomainModel EndUser => new DomainModel(Guid.Parse("816e7126-2034-49b3-af08-d07cab150d93")) + { + Description = "A standard end user.", + Name = "End User" + }; + + /// + /// Gets the system administrator user role. + /// + public static DomainModel SystemAdministrator => new DomainModel(Guid.Parse("b13c7a39-0c65-4515-a4af-2e3f60d289ba")) + { + Description = "A user with full administrative privileges.", + Name = "System Administrator" + }; + } + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IAggregateDomainModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IAggregateDomainModel.cs new file mode 100644 index 00000000..866f6eee --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IAggregateDomainModel.cs @@ -0,0 +1,52 @@ +// ================================================================================================================================= +// 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.UserRole +{ + /// + /// Represents a user role. + /// + public interface IAggregateDomainModel : IAggregateModel, IBaseDomainModel, IValueDomainModel + { + /// + /// Gets or sets the description for the current . + /// + /// + /// is empty. + /// + /// + /// is . + /// + /// + /// is too long. + /// + public new String Description + { + get; + set; + } + + /// + /// Gets or sets the name of the current . + /// + /// + /// is empty. + /// + /// + /// is . + /// + /// + /// is too long. + /// + public new String Name + { + get; + set; + } + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/AssemblyAttributes.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IAggregateModel.cs similarity index 63% rename from example/RapidField.SolidInstruments.Example.Domain/AssemblyAttributes.cs rename to example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IAggregateModel.cs index f24e80ba..15796706 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/AssemblyAttributes.cs +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IAggregateModel.cs @@ -2,7 +2,12 @@ // Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. // ================================================================================================================================= -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("RapidField.SolidInstruments.Example.Domain.AccessControl")] -[assembly: InternalsVisibleTo("RapidField.SolidInstruments.Example.Domain.AccessControl.Service")] \ No newline at end of file +namespace RapidField.SolidInstruments.Example.Domain.Models.UserRole +{ + /// + /// Represents a user role. + /// + public interface IAggregateModel : IValueModel + { + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IValueDomainModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IValueDomainModel.cs new file mode 100644 index 00000000..18749108 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IValueDomainModel.cs @@ -0,0 +1,15 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using IBaseDomainModel = RapidField.SolidInstruments.Core.Domain.IGlobalIdentityValueDomainModel; + +namespace RapidField.SolidInstruments.Example.Domain.Models.UserRole +{ + /// + /// Represents a user role. + /// + public interface IValueDomainModel : IBaseDomainModel, IValueModel + { + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IValueModel.cs.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IValueModel.cs.cs new file mode 100644 index 00000000..408cfa68 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/IValueModel.cs.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 RapidField.SolidInstruments.Core; +using System; + +namespace RapidField.SolidInstruments.Example.Domain.Models.UserRole +{ + /// + /// Represents a user role. + /// + public interface IValueModel : IGlobalIdentityModel + { + /// + /// Gets the description of the current . + /// + public String Description + { + 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/Models/UserRole/ValueDataAccessModel.cs b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/ValueDataAccessModel.cs new file mode 100644 index 00000000..b04278a5 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Models/UserRole/ValueDataAccessModel.cs @@ -0,0 +1,70 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Diagnostics; +using System.Runtime.Serialization; +using AssociatedDomainModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; + +namespace RapidField.SolidInstruments.Example.Domain.Models.UserRole +{ + using BaseDataAccessModel = DataAccess.EntityFramework.EntityFrameworkGlobalIdentityDataAccessModel; + + /// + /// Represents a user role. + /// + [DataContract(Name = DataContractName)] + [Table(TableName)] + public class ValueDataAccessModel : BaseDataAccessModel, IValueModel + { + /// + /// Initializes a new instance of the class. + /// + public ValueDataAccessModel() + : base() + { + return; + } + + /// + /// Gets or sets the description of the current . + /// + [Column] + [DataMember] + [Required] + [StringLength(AssociatedDomainModel.DescriptionValueMaximumLength)] + public String Description + { + get; + set; + } + + /// + /// Gets or sets the name of the current . + /// + [Column] + [DataMember] + [Required] + [StringLength(AssociatedDomainModel.NameValueMaximumLength)] + public String Name + { + get; + set; + } + + /// + /// Represents the name that is used when representing this type as a database entity. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + internal const String TableName = AssociatedDomainModel.DataContractName; + + /// + /// Represents the name that is used when representing this type in serialization and transport contexts. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private const String DataContractName = TableName + nameof(ValueDataAccessModel); + } +} \ No newline at end of file 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 4ebef701..f1908787 100644 --- a/example/RapidField.SolidInstruments.Example.Domain/RapidField.SolidInstruments.Example.Domain.csproj +++ b/example/RapidField.SolidInstruments.Example.Domain/RapidField.SolidInstruments.Example.Domain.csproj @@ -32,4 +32,12 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in + + + + + + + + \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Repositories/UserRole/AggregateModelRepository.cs b/example/RapidField.SolidInstruments.Example.Domain/Repositories/UserRole/AggregateModelRepository.cs new file mode 100644 index 00000000..bb34d8be --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Repositories/UserRole/AggregateModelRepository.cs @@ -0,0 +1,37 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using Microsoft.EntityFrameworkCore; +using RapidField.SolidInstruments.DataAccess.EntityFramework; +using System; +using DataAccessModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.AggregateDataAccessModel; +using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; + +namespace RapidField.SolidInstruments.Example.Domain.Repositories.UserRole +{ + /// + /// Performs data access operations for the type. + /// + /// + /// The type of the database session for the repository. + /// + public class AggregateModelRepository : EntityFrameworkGlobalIdentityRepository + where TContext : DbContext + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The database session for the repository. + /// + /// + /// is . + /// + public AggregateModelRepository(TContext context) + : base(context) + { + return; + } + } +} \ No newline at end of file diff --git a/example/RapidField.SolidInstruments.Example.Domain/Repositories/UserRole/ValueModelRepository.cs b/example/RapidField.SolidInstruments.Example.Domain/Repositories/UserRole/ValueModelRepository.cs new file mode 100644 index 00000000..ffe8b524 --- /dev/null +++ b/example/RapidField.SolidInstruments.Example.Domain/Repositories/UserRole/ValueModelRepository.cs @@ -0,0 +1,37 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using Microsoft.EntityFrameworkCore; +using RapidField.SolidInstruments.DataAccess.EntityFramework; +using System; +using DataAccessModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.ValueDataAccessModel; +using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.UserRole.DomainModel; + +namespace RapidField.SolidInstruments.Example.Domain.Repositories.UserRole +{ + /// + /// Performs data access operations for the type. + /// + /// + /// The type of the database session for the repository. + /// + public class ValueModelRepository : EntityFrameworkGlobalIdentityRepository + where TContext : DbContext + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The database session for the repository. + /// + /// + /// is . + /// + public ValueModelRepository(TContext context) + : base(context) + { + return; + } + } +} \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.Command/Command.cs b/src/RapidField.SolidInstruments.Command/Command.cs index 4db5b147..52df011b 100644 --- a/src/RapidField.SolidInstruments.Command/Command.cs +++ b/src/RapidField.SolidInstruments.Command/Command.cs @@ -83,6 +83,12 @@ public Guid CorrelationIdentifier [IgnoreDataMember] internal Guid? CorrelationIdentifierField; + /// + /// Represents the standard noun appendage to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameSuffix = Command.DataContractNameSuffix; + /// /// Represents the type of the result that is emitted when processing the command. /// @@ -153,6 +159,12 @@ public Guid CorrelationIdentifier [IgnoreDataMember] public virtual Type ResultType => Nix.Type; + /// + /// Represents the standard noun appendage to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameSuffix = "Command"; + /// /// Represents a unique identifier that is assigned to related commands. /// diff --git a/src/RapidField.SolidInstruments.Command/CommandHandler.cs b/src/RapidField.SolidInstruments.Command/CommandHandler.cs index 7f6ac856..6d6d6ea4 100644 --- a/src/RapidField.SolidInstruments.Command/CommandHandler.cs +++ b/src/RapidField.SolidInstruments.Command/CommandHandler.cs @@ -84,6 +84,10 @@ public Nix Process(TCommand command) /// /// Processes the specified command. /// + /// + /// Do not process using , as doing so will generally result in + /// infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The command to process. /// @@ -182,6 +186,10 @@ public TResult Process(TCommand command) /// /// Processes the specified command. /// + /// + /// Do not process using , as doing so will generally result in + /// infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The command to process. /// diff --git a/src/RapidField.SolidInstruments.Command/CreateDomainModelCommand.cs b/src/RapidField.SolidInstruments.Command/CreateDomainModelCommand.cs index 4fe32d45..d40f64eb 100644 --- a/src/RapidField.SolidInstruments.Command/CreateDomainModelCommand.cs +++ b/src/RapidField.SolidInstruments.Command/CreateDomainModelCommand.cs @@ -124,5 +124,11 @@ public CreateDomainModelCommand(TModel model, IEnumerable labels, Guid c { return; } + + /// + /// Represents the standard verb which is prefixed to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameVerb = "Create"; } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.Command/DeleteDomainModelCommand.cs b/src/RapidField.SolidInstruments.Command/DeleteDomainModelCommand.cs index d1ebe18d..a1c54743 100644 --- a/src/RapidField.SolidInstruments.Command/DeleteDomainModelCommand.cs +++ b/src/RapidField.SolidInstruments.Command/DeleteDomainModelCommand.cs @@ -124,5 +124,11 @@ public DeleteDomainModelCommand(TModel model, IEnumerable labels, Guid c { return; } + + /// + /// Represents the standard verb which is prefixed to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameVerb = "Delete"; } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.Command/UpdateDomainModelCommand.cs b/src/RapidField.SolidInstruments.Command/UpdateDomainModelCommand.cs index a51a4f46..816f260f 100644 --- a/src/RapidField.SolidInstruments.Command/UpdateDomainModelCommand.cs +++ b/src/RapidField.SolidInstruments.Command/UpdateDomainModelCommand.cs @@ -124,5 +124,11 @@ public UpdateDomainModelCommand(TModel model, IEnumerable labels, Guid c { return; } + + /// + /// Represents the standard verb which is prefixed to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameVerb = "Update"; } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.Core/DateTimeRange.cs b/src/RapidField.SolidInstruments.Core/DateTimeRange.cs index 5a1fbee1..5768b472 100644 --- a/src/RapidField.SolidInstruments.Core/DateTimeRange.cs +++ b/src/RapidField.SolidInstruments.Core/DateTimeRange.cs @@ -15,6 +15,25 @@ namespace RapidField.SolidInstruments.Core /// /// Represents the span of a contiguous period of time with specific start and end points. /// + /// + /// This example demonstrates the capabilities of the class. + /// + ///var start = new DateTime(1997, 11, 6, 14, 7, 46, 482, DateTimeKind.Local); + ///var end = new DateTime(2024, 2, 29, 17, 41, 10, 193, DateTimeKind.Local); + ///var range = new DateTimeRange(start, end); + ///var containsStart = range.Contains(start); // true + ///var containsEnd = range.Contains(end); // true + ///var containsMidpoint = range.Contains(range.Midpoint); // true + ///var lengthInYears = range.LengthInYears; // 26 + ///var lengthInMonths = range.LengthInMonths; // 315 + ///var lengthInWeeks = range.LengthInWeeks; // 1373 + ///var lengthInDays = range.LengthInDays; // 9611 + ///var lengthInHours = range.LengthInHours; // 230667 + ///var lengthInMinutes = range.LengthInMinutes; // 13840053 + ///var lengthInSeconds = range.LengthInSeconds; // 830403203 + ///var lengthInMilliseconds = range.LengthInMilliseconds; // 830403203711 + /// + /// [DataContract] public sealed class DateTimeRange : ICloneable, IEquatable { diff --git a/src/RapidField.SolidInstruments.Core/Extensions/ByteCollectionExtensions.cs b/src/RapidField.SolidInstruments.Core/Extensions/ByteCollectionExtensions.cs index 1b3a74df..6751268c 100644 --- a/src/RapidField.SolidInstruments.Core/Extensions/ByteCollectionExtensions.cs +++ b/src/RapidField.SolidInstruments.Core/Extensions/ByteCollectionExtensions.cs @@ -9,6 +9,7 @@ using System.IO; using System.IO.Compression; using System.Linq; +using System.Runtime.CompilerServices; using System.Security.Cryptography; namespace RapidField.SolidInstruments.Core.Extensions @@ -250,6 +251,7 @@ public static Byte[] PerformCircularBitShift(this Byte[] target, BitShiftDirecti /// The current instance of the . /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static Byte[] ComputeOneHundredTwentyEightBitHashBuffer(this IEnumerable target) { var rawHash = target.ComputeTwoHundredFiftySixBitHashBuffer(); @@ -266,6 +268,7 @@ private static Byte[] ComputeOneHundredTwentyEightBitHashBuffer(this IEnumerable /// The current instance of the . /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static Byte[] ComputeSixtyFourBitHashBuffer(this IEnumerable target) { var rawHash = target.ComputeOneHundredTwentyEightBitHashBuffer(); @@ -282,6 +285,7 @@ private static Byte[] ComputeSixtyFourBitHashBuffer(this IEnumerable targe /// The current instance of the . /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static Byte[] ComputeThirtyTwoBitHashBuffer(this IEnumerable target) { var rawHash = target.ComputeSixtyFourBitHashBuffer(); @@ -298,6 +302,7 @@ private static Byte[] ComputeThirtyTwoBitHashBuffer(this IEnumerable targe /// The current instance of the . /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static Byte[] ComputeTwoHundredFiftySixBitHashBuffer(this IEnumerable target) { if (target.Any()) diff --git a/src/RapidField.SolidInstruments.Core/Instrument.cs b/src/RapidField.SolidInstruments.Core/Instrument.cs index 98062972..a13b3ec3 100644 --- a/src/RapidField.SolidInstruments.Core/Instrument.cs +++ b/src/RapidField.SolidInstruments.Core/Instrument.cs @@ -7,6 +7,7 @@ using RapidField.SolidInstruments.Core.Extensions; using System; using System.Diagnostics; +using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; @@ -136,6 +137,8 @@ protected virtual void Dispose(Boolean disposing) /// /// The object is disposed. /// + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected void RejectIfDisposed() { if (IsDisposedOrDisposing) diff --git a/src/RapidField.SolidInstruments.Cryptography/SecureMemory.cs b/src/RapidField.SolidInstruments.Cryptography/SecureMemory.cs index 7f4750d8..8a56b1eb 100644 --- a/src/RapidField.SolidInstruments.Cryptography/SecureMemory.cs +++ b/src/RapidField.SolidInstruments.Cryptography/SecureMemory.cs @@ -12,6 +12,7 @@ using System; using System.Diagnostics; using System.Linq; +using System.Runtime.CompilerServices; using System.Security.Cryptography; using System.Threading.Tasks; @@ -182,6 +183,7 @@ void ISecureMemory.RegeneratePrivateKey() /// The resulting private key. /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal PinnedMemory DerivePrivateKey() => DerivePrivateKey(PrivateKeySource, PrivateKeySourceBitShiftDirection, PrivateKeySourceBitShiftCount, Cipher.KeySizeInBytes); /// @@ -230,6 +232,7 @@ protected override void Dispose(Boolean disposing) /// The resulting private key. /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static PinnedMemory DerivePrivateKey(Byte[] privateKeySource, BitShiftDirection bitShiftDirection, Int32 bitShiftCount, Int32 keyLengthInBytes) => new PinnedMemory(new Span(privateKeySource.PerformCircularBitShift(bitShiftDirection, bitShiftCount)).Slice(0, keyLengthInBytes).ToArray(), true); /// @@ -239,6 +242,7 @@ protected override void Dispose(Boolean disposing) /// The bit field to which the plaintext result is written. /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private void DecryptField(PinnedMemory plaintext) { using var privateKey = DerivePrivateKey(); @@ -253,6 +257,7 @@ private void DecryptField(PinnedMemory plaintext) /// The bit field containing the plaintext to encrypt. /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private void EncryptField(PinnedMemory plaintext) { using var initializationVector = new PinnedMemory(Cipher.BlockSizeInBytes, true); @@ -400,6 +405,7 @@ internal InflatedField(Int32 length, Int32 multiplier, RandomNumberGenerator ran /// The object is disposed. /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void Scramble() { using (var controlToken = StateControl.Enter()) @@ -450,6 +456,7 @@ protected override void Dispose(Boolean disposing) /// The object is disposed. /// [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private PinnedMemory GetTargetField() { using (var controlToken = StateControl.Enter()) diff --git a/src/RapidField.SolidInstruments.DataAccess/CreateOrUpdateDataAccessModelCommandHandler.cs b/src/RapidField.SolidInstruments.DataAccess/CreateOrUpdateDataAccessModelCommandHandler.cs index ed26d386..2a8c682c 100644 --- a/src/RapidField.SolidInstruments.DataAccess/CreateOrUpdateDataAccessModelCommandHandler.cs +++ b/src/RapidField.SolidInstruments.DataAccess/CreateOrUpdateDataAccessModelCommandHandler.cs @@ -63,6 +63,10 @@ public CreateOrUpdateDataAccessModelCommandHandler(ICommandMediator mediator, ID /// /// Processes the specified command. /// + /// + /// Do not process using , as doing so will generally result in + /// infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The command to process. /// diff --git a/src/RapidField.SolidInstruments.DataAccess/DataAccessCommandHandler.cs b/src/RapidField.SolidInstruments.DataAccess/DataAccessCommandHandler.cs index e4026bf4..9fbf919f 100644 --- a/src/RapidField.SolidInstruments.DataAccess/DataAccessCommandHandler.cs +++ b/src/RapidField.SolidInstruments.DataAccess/DataAccessCommandHandler.cs @@ -115,6 +115,10 @@ protected sealed override void Process(TCommand command, ICommandMediator mediat /// /// Processes the specified command. /// + /// + /// Do not process using , as doing so will generally result in + /// infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The command to process. /// @@ -289,6 +293,10 @@ protected sealed override TResult Process(TCommand command, ICommandMediator med /// /// Processes the specified command. /// + /// + /// Do not process using , as doing so will generally result in + /// infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The command to process. /// diff --git a/src/RapidField.SolidInstruments.DataAccess/DataAccessModelCommandHandler.cs b/src/RapidField.SolidInstruments.DataAccess/DataAccessModelCommandHandler.cs index b39011ed..af14e03c 100644 --- a/src/RapidField.SolidInstruments.DataAccess/DataAccessModelCommandHandler.cs +++ b/src/RapidField.SolidInstruments.DataAccess/DataAccessModelCommandHandler.cs @@ -90,6 +90,10 @@ protected DataAccessModelCommandHandler(ICommandMediator mediator, IDataAccessRe /// /// Processes the specified command. /// + /// + /// Do not process using , as doing so will generally result in + /// infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The command to process. /// @@ -193,6 +197,10 @@ protected DataAccessModelCommandHandler(ICommandMediator mediator, IDataAccessRe /// /// Processes the specified command. /// + /// + /// Do not process using , as doing so will generally result in + /// infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The command to process. /// diff --git a/src/RapidField.SolidInstruments.EventAuthoring/DomainModelAssociatedEvent.cs b/src/RapidField.SolidInstruments.EventAuthoring/DomainModelAssociatedEvent.cs index 588ff904..192c0baf 100644 --- a/src/RapidField.SolidInstruments.EventAuthoring/DomainModelAssociatedEvent.cs +++ b/src/RapidField.SolidInstruments.EventAuthoring/DomainModelAssociatedEvent.cs @@ -176,5 +176,11 @@ public DomainModelAssociatedEvent(TModel model, IEnumerable labels, Even { return; } + + /// + /// Represents the standard verb which is appended to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameVerb = "Associated"; } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.EventAuthoring/DomainModelCreatedEvent.cs b/src/RapidField.SolidInstruments.EventAuthoring/DomainModelCreatedEvent.cs index 1f328fad..ce9dd6ad 100644 --- a/src/RapidField.SolidInstruments.EventAuthoring/DomainModelCreatedEvent.cs +++ b/src/RapidField.SolidInstruments.EventAuthoring/DomainModelCreatedEvent.cs @@ -176,5 +176,11 @@ public DomainModelCreatedEvent(TModel model, IEnumerable labels, EventVe { return; } + + /// + /// Represents the standard verb which is appended to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameVerb = "Created"; } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.EventAuthoring/DomainModelDeletedEvent.cs b/src/RapidField.SolidInstruments.EventAuthoring/DomainModelDeletedEvent.cs index d7cc1255..effedf98 100644 --- a/src/RapidField.SolidInstruments.EventAuthoring/DomainModelDeletedEvent.cs +++ b/src/RapidField.SolidInstruments.EventAuthoring/DomainModelDeletedEvent.cs @@ -176,5 +176,11 @@ public DomainModelDeletedEvent(TModel model, IEnumerable labels, EventVe { return; } + + /// + /// Represents the standard verb which is appended to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameVerb = "Deleted"; } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.EventAuthoring/DomainModelUpdatedEvent.cs b/src/RapidField.SolidInstruments.EventAuthoring/DomainModelUpdatedEvent.cs index 93d95954..54094bd9 100644 --- a/src/RapidField.SolidInstruments.EventAuthoring/DomainModelUpdatedEvent.cs +++ b/src/RapidField.SolidInstruments.EventAuthoring/DomainModelUpdatedEvent.cs @@ -176,5 +176,11 @@ public DomainModelUpdatedEvent(TModel model, IEnumerable labels, EventVe { return; } + + /// + /// Represents the standard verb which is appended to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameVerb = "Updated"; } } \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.EventAuthoring/Event.cs b/src/RapidField.SolidInstruments.EventAuthoring/Event.cs index b435f62c..fcf5c7b3 100644 --- a/src/RapidField.SolidInstruments.EventAuthoring/Event.cs +++ b/src/RapidField.SolidInstruments.EventAuthoring/Event.cs @@ -534,6 +534,12 @@ public EventVerbosity Verbosity [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal const SerializationFormat ToByteArraySerializationFormat = SerializationFormat.CompressedJson; + /// + /// Represents the standard noun appendage to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal new const String DataContractNameSuffix = "Event"; + /// /// Represents the default event category. /// diff --git a/src/RapidField.SolidInstruments.Messaging.Autofac/Service/AutofacBeaconServiceExecutor.cs b/src/RapidField.SolidInstruments.Messaging.Autofac/Service/AutofacBeaconServiceExecutor.cs new file mode 100644 index 00000000..b9a783ed --- /dev/null +++ b/src/RapidField.SolidInstruments.Messaging.Autofac/Service/AutofacBeaconServiceExecutor.cs @@ -0,0 +1,173 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using Microsoft.Extensions.DependencyInjection; +using RapidField.SolidInstruments.Core; +using RapidField.SolidInstruments.InversionOfControl; +using RapidField.SolidInstruments.InversionOfControl.Autofac; +using RapidField.SolidInstruments.Messaging.Service; +using System; + +namespace RapidField.SolidInstruments.Messaging.Autofac.Service +{ + /// + /// Prepares for and performs execution of a messaging service that publishes periodic instances + /// and responds to instances using an Autofac dependency package. + /// + /// + /// This service executor can be used to facilitate signaling for repeating and/or scheduled events. It can also be used as a + /// facility for other services to test message transport availability and latency. + /// + /// + /// The type of the package that configures the dependency engine. + /// + public abstract class AutofacBeaconServiceExecutor : BeaconServiceExecutor + where TDependencyPackage : class, IDependencyPackage, new() + { + /// + /// Initializes a new instance of the class. + /// + protected AutofacBeaconServiceExecutor() + : base() + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// A value indicating whether or not the service publishes frequency "A" heartbeat messages every thirteen (13) seconds + /// [0.22 minutes / 6,646 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "B" heartbeat messages every 89 seconds [1.48 minutes + /// / 0.02 hours / 970 times per calendar day]. The default value is . + /// + protected AutofacBeaconServiceExecutor(Boolean publishesFrequencyAHeartbeats, Boolean publishesFrequencyBHeartbeats) + : base(publishesFrequencyAHeartbeats, publishesFrequencyBHeartbeats) + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// A value indicating whether or not the service publishes frequency "A" heartbeat messages every thirteen (13) seconds + /// [0.22 minutes / 6,646 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "B" heartbeat messages every 89 seconds [1.48 minutes + /// / 0.02 hours / 970 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "C" heartbeat messages every 233 seconds [3.88 minutes + /// / 0.06 hours / 370 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "D" heartbeat messages every 1,597 seconds [26.62 + /// minutes / 0.44 hours / 54 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "E" heartbeat messages every 28,657 seconds [477.62 + /// minutes / 7.96 hours / three (3) times per calendar day]. The default value is . + /// + protected AutofacBeaconServiceExecutor(Boolean publishesFrequencyAHeartbeats, Boolean publishesFrequencyBHeartbeats, Boolean publishesFrequencyCHeartbeats, Boolean publishesFrequencyDHeartbeats, Boolean publishesFrequencyEHeartbeats) + : base(publishesFrequencyAHeartbeats, publishesFrequencyBHeartbeats, publishesFrequencyCHeartbeats, publishesFrequencyDHeartbeats, publishesFrequencyEHeartbeats) + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the service. The default value is "Beacon Service". + /// + /// + /// is empty. + /// + /// + /// is . + /// + protected AutofacBeaconServiceExecutor(String serviceName) + : base(serviceName) + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the service. The default value is "Beacon Service". + /// + /// + /// A value indicating whether or not the service publishes frequency "A" heartbeat messages every thirteen (13) seconds + /// [0.22 minutes / 6,646 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "B" heartbeat messages every 89 seconds [1.48 minutes + /// / 0.02 hours / 970 times per calendar day]. The default value is . + /// + /// + /// is empty. + /// + /// + /// is . + /// + protected AutofacBeaconServiceExecutor(String serviceName, Boolean publishesFrequencyAHeartbeats, Boolean publishesFrequencyBHeartbeats) + : base(serviceName, publishesFrequencyAHeartbeats, publishesFrequencyBHeartbeats) + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the service. The default value is "Beacon Service". + /// + /// + /// A value indicating whether or not the service publishes frequency "A" heartbeat messages every thirteen (13) seconds + /// [0.22 minutes / 6,646 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "B" heartbeat messages every 89 seconds [1.48 minutes + /// / 0.02 hours / 970 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "C" heartbeat messages every 233 seconds [3.88 minutes + /// / 0.06 hours / 370 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "D" heartbeat messages every 1,597 seconds [26.62 + /// minutes / 0.44 hours / 54 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "E" heartbeat messages every 28,657 seconds [477.62 + /// minutes / 7.96 hours / three (3) times per calendar day]. The default value is . + /// + /// + /// is empty. + /// + /// + /// is . + /// + protected AutofacBeaconServiceExecutor(String serviceName, Boolean publishesFrequencyAHeartbeats, Boolean publishesFrequencyBHeartbeats, Boolean publishesFrequencyCHeartbeats, Boolean publishesFrequencyDHeartbeats, Boolean publishesFrequencyEHeartbeats) + : base(serviceName, publishesFrequencyAHeartbeats, publishesFrequencyBHeartbeats, publishesFrequencyCHeartbeats, publishesFrequencyDHeartbeats, publishesFrequencyEHeartbeats) + { + return; + } + + /// + /// Releases all resources consumed by the current . + /// + /// + /// A value indicating whether or not managed resources should be released. + /// + protected override void Dispose(Boolean disposing) => base.Dispose(disposing); + } +} \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.Messaging.DotNetNative/Service/DotNetNativeBeaconServiceExecutor.cs b/src/RapidField.SolidInstruments.Messaging.DotNetNative/Service/DotNetNativeBeaconServiceExecutor.cs new file mode 100644 index 00000000..f83bcb50 --- /dev/null +++ b/src/RapidField.SolidInstruments.Messaging.DotNetNative/Service/DotNetNativeBeaconServiceExecutor.cs @@ -0,0 +1,173 @@ +// ================================================================================================================================= +// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. +// ================================================================================================================================= + +using Microsoft.Extensions.DependencyInjection; +using RapidField.SolidInstruments.Core; +using RapidField.SolidInstruments.InversionOfControl; +using RapidField.SolidInstruments.InversionOfControl.DotNetNative; +using RapidField.SolidInstruments.Messaging.Service; +using System; + +namespace RapidField.SolidInstruments.Messaging.DotNetNative.Service +{ + /// + /// Prepares for and performs execution of a messaging service that publishes periodic instances + /// and responds to instances using a native .NET dependency package. + /// + /// + /// This service executor can be used to facilitate signaling for repeating and/or scheduled events. It can also be used as a + /// facility for other services to test message transport availability and latency. + /// + /// + /// The type of the package that configures the dependency engine. + /// + public abstract class DotNetNativeBeaconServiceExecutor : BeaconServiceExecutor + where TDependencyPackage : class, IDependencyPackage, new() + { + /// + /// Initializes a new instance of the class. + /// + protected DotNetNativeBeaconServiceExecutor() + : base() + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// A value indicating whether or not the service publishes frequency "A" heartbeat messages every thirteen (13) seconds + /// [0.22 minutes / 6,646 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "B" heartbeat messages every 89 seconds [1.48 minutes + /// / 0.02 hours / 970 times per calendar day]. The default value is . + /// + protected DotNetNativeBeaconServiceExecutor(Boolean publishesFrequencyAHeartbeats, Boolean publishesFrequencyBHeartbeats) + : base(publishesFrequencyAHeartbeats, publishesFrequencyBHeartbeats) + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// A value indicating whether or not the service publishes frequency "A" heartbeat messages every thirteen (13) seconds + /// [0.22 minutes / 6,646 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "B" heartbeat messages every 89 seconds [1.48 minutes + /// / 0.02 hours / 970 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "C" heartbeat messages every 233 seconds [3.88 minutes + /// / 0.06 hours / 370 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "D" heartbeat messages every 1,597 seconds [26.62 + /// minutes / 0.44 hours / 54 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "E" heartbeat messages every 28,657 seconds [477.62 + /// minutes / 7.96 hours / three (3) times per calendar day]. The default value is . + /// + protected DotNetNativeBeaconServiceExecutor(Boolean publishesFrequencyAHeartbeats, Boolean publishesFrequencyBHeartbeats, Boolean publishesFrequencyCHeartbeats, Boolean publishesFrequencyDHeartbeats, Boolean publishesFrequencyEHeartbeats) + : base(publishesFrequencyAHeartbeats, publishesFrequencyBHeartbeats, publishesFrequencyCHeartbeats, publishesFrequencyDHeartbeats, publishesFrequencyEHeartbeats) + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the service. The default value is "Beacon Service". + /// + /// + /// is empty. + /// + /// + /// is . + /// + protected DotNetNativeBeaconServiceExecutor(String serviceName) + : base(serviceName) + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the service. The default value is "Beacon Service". + /// + /// + /// A value indicating whether or not the service publishes frequency "A" heartbeat messages every thirteen (13) seconds + /// [0.22 minutes / 6,646 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "B" heartbeat messages every 89 seconds [1.48 minutes + /// / 0.02 hours / 970 times per calendar day]. The default value is . + /// + /// + /// is empty. + /// + /// + /// is . + /// + protected DotNetNativeBeaconServiceExecutor(String serviceName, Boolean publishesFrequencyAHeartbeats, Boolean publishesFrequencyBHeartbeats) + : base(serviceName, publishesFrequencyAHeartbeats, publishesFrequencyBHeartbeats) + { + return; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the service. The default value is "Beacon Service". + /// + /// + /// A value indicating whether or not the service publishes frequency "A" heartbeat messages every thirteen (13) seconds + /// [0.22 minutes / 6,646 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "B" heartbeat messages every 89 seconds [1.48 minutes + /// / 0.02 hours / 970 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "C" heartbeat messages every 233 seconds [3.88 minutes + /// / 0.06 hours / 370 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "D" heartbeat messages every 1,597 seconds [26.62 + /// minutes / 0.44 hours / 54 times per calendar day]. The default value is . + /// + /// + /// A value indicating whether or not the service publishes frequency "E" heartbeat messages every 28,657 seconds [477.62 + /// minutes / 7.96 hours / three (3) times per calendar day]. The default value is . + /// + /// + /// is empty. + /// + /// + /// is . + /// + protected DotNetNativeBeaconServiceExecutor(String serviceName, Boolean publishesFrequencyAHeartbeats, Boolean publishesFrequencyBHeartbeats, Boolean publishesFrequencyCHeartbeats, Boolean publishesFrequencyDHeartbeats, Boolean publishesFrequencyEHeartbeats) + : base(serviceName, publishesFrequencyAHeartbeats, publishesFrequencyBHeartbeats, publishesFrequencyCHeartbeats, publishesFrequencyDHeartbeats, publishesFrequencyEHeartbeats) + { + return; + } + + /// + /// Releases all resources consumed by the current . + /// + /// + /// A value indicating whether or not managed resources should be released. + /// + protected override void Dispose(Boolean disposing) => base.Dispose(disposing); + } +} \ No newline at end of file diff --git a/src/RapidField.SolidInstruments.Messaging/Message.cs b/src/RapidField.SolidInstruments.Messaging/Message.cs index 4939dfcb..85d110f7 100644 --- a/src/RapidField.SolidInstruments.Messaging/Message.cs +++ b/src/RapidField.SolidInstruments.Messaging/Message.cs @@ -215,6 +215,12 @@ public IMessageProcessingInformation ProcessingInformation [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static MessagingEntityType ResponseEntityType = MessagingEntityType.Topic; + /// + /// Represents the standard noun appendage to the name that is used when representing this type in serialization and + /// transport contexts. + /// + protected internal const String DataContractNameSuffix = "Message"; + /// /// Represents a unique identifier that is assigned to related messages. /// diff --git a/src/RapidField.SolidInstruments.Messaging/Service/HeartbeatMessageListener.cs b/src/RapidField.SolidInstruments.Messaging/Service/HeartbeatMessageListener.cs index aada047b..cd45a054 100644 --- a/src/RapidField.SolidInstruments.Messaging/Service/HeartbeatMessageListener.cs +++ b/src/RapidField.SolidInstruments.Messaging/Service/HeartbeatMessageListener.cs @@ -96,6 +96,10 @@ protected sealed override void Process(HeartbeatMessage command, ICommandMediato /// at a custom /// frequency. /// + /// + /// Do not process using , as doing so will generally + /// result in infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The heartbeat message to process. /// @@ -122,6 +126,10 @@ protected virtual void ProcessCustomFrequencyHeartbeat(HeartbeatMessage heartbea /// "A" heartbeat messages to be suppressed. Publishing of frequency "A" heartbeat messages can be enabled by using one of /// several non-default constructors for that class. /// + /// + /// Do not process using , as doing so will generally + /// result in infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The heartbeat message to process. /// @@ -148,6 +156,10 @@ protected virtual void ProcessFrequencyAHeartbeatMessage(HeartbeatMessage heartb /// "B" heartbeat messages to be suppressed. Publishing of frequency "B" heartbeat messages can be enabled by using one of /// several non-default constructors for that class. /// + /// + /// Do not process using , as doing so will generally + /// result in infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The heartbeat message to process. /// @@ -174,6 +186,10 @@ protected virtual void ProcessFrequencyBHeartbeatMessage(HeartbeatMessage heartb /// "C" heartbeat messages to be transmitted. Publishing of frequency "C" heartbeat messages can be disabled by using one of /// several non-default constructors for that class. /// + /// + /// Do not process using , as doing so will generally + /// result in infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The heartbeat message to process. /// @@ -200,6 +216,10 @@ protected virtual void ProcessFrequencyCHeartbeatMessage(HeartbeatMessage heartb /// "D" heartbeat messages to be transmitted. Publishing of frequency "D" heartbeat messages can be disabled by using one of /// several non-default constructors for that class. /// + /// + /// Do not process using , as doing so will generally + /// result in infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The heartbeat message to process. /// @@ -226,6 +246,10 @@ protected virtual void ProcessFrequencyDHeartbeatMessage(HeartbeatMessage heartb /// "E" heartbeat messages to be transmitted. Publishing of frequency "E" heartbeat messages can be disabled by using one of /// several non-default constructors for that class. /// + /// + /// Do not process using , as doing so will generally + /// result in infinite-looping; is exposed to this method to facilitate sub-command processing. + /// /// /// The heartbeat message to process. ///