-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#371 Introduce working example service.
- Loading branch information
1 parent
60a9539
commit 9b305c7
Showing
64 changed files
with
669 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
example/RapidField.SolidInstruments.Example.Domain.AccessControl/AssemblyAttributes.cs
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
example/RapidField.SolidInstruments.Example.Domain.AccessControl/CommandHandlerModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// ================================================================================================================================= | ||
// 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.Command.DotNetNative; | ||
using System; | ||
|
||
namespace RapidField.SolidInstruments.Example.Domain.AccessControl | ||
{ | ||
/// <summary> | ||
/// Encapsulates container configuration for access control domain command handlers. | ||
/// </summary> | ||
public sealed class CommandHandlerModule : DotNetNativeCommandHandlerModule | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="CommandHandlerModule" /> class. | ||
/// </summary> | ||
/// <param name="applicationConfiguration"> | ||
/// Configuration information for the application. | ||
/// </param> | ||
/// <exception cref="ArgumentNullException"> | ||
/// <paramref name="applicationConfiguration" /> is <see langword="null" />. | ||
/// </exception> | ||
public CommandHandlerModule(IConfiguration applicationConfiguration) | ||
: base(applicationConfiguration) | ||
{ | ||
return; | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...e.Domain.AccessControl/CommandHandlers/ModelState/User/CreateDomainModelCommandHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.User.AggregateDataAccessModel; | ||
using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel; | ||
using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.User.CreateDomainModelCommand; | ||
|
||
namespace RapidField.SolidInstruments.Example.Domain.AccessControl.CommandHandlers.ModelState.User | ||
{ | ||
/// <summary> | ||
/// Processes a single <see cref="DomainModelCommand" />. | ||
/// </summary> | ||
public sealed class CreateDomainModelCommandHandler : CreateDomainModelCommandHandler<Guid, DomainModel, DataAccessModel, DomainModelCommand> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="CreateDomainModelCommandHandler" /> class. | ||
/// </summary> | ||
/// <param name="mediator"> | ||
/// A processing intermediary that is used to process sub-commands. | ||
/// </param> | ||
/// <exception cref="ArgumentNullException"> | ||
/// <paramref name="mediator" /> is <see langword="null" />. | ||
/// </exception> | ||
public CreateDomainModelCommandHandler(ICommandMediator mediator) | ||
: base(mediator) | ||
{ | ||
return; | ||
} | ||
|
||
/// <summary> | ||
/// Releases all resources consumed by the current <see cref="CreateDomainModelCommandHandler" />. | ||
/// </summary> | ||
/// <param name="disposing"> | ||
/// A value indicating whether or not managed resources should be released. | ||
/// </param> | ||
protected override void Dispose(Boolean disposing) => base.Dispose(disposing); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...e.Domain.AccessControl/CommandHandlers/ModelState/User/DeleteDomainModelCommandHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.User.AggregateDataAccessModel; | ||
using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel; | ||
using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.User.DeleteDomainModelCommand; | ||
|
||
namespace RapidField.SolidInstruments.Example.Domain.AccessControl.CommandHandlers.ModelState.User | ||
{ | ||
/// <summary> | ||
/// Processes a single <see cref="DomainModelCommand" />. | ||
/// </summary> | ||
public sealed class DeleteDomainModelCommandHandler : DeleteDomainModelCommandHandler<Guid, DomainModel, DataAccessModel, DomainModelCommand> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DeleteDomainModelCommandHandler" /> class. | ||
/// </summary> | ||
/// <param name="mediator"> | ||
/// A processing intermediary that is used to process sub-commands. | ||
/// </param> | ||
/// <exception cref="ArgumentNullException"> | ||
/// <paramref name="mediator" /> is <see langword="null" />. | ||
/// </exception> | ||
public DeleteDomainModelCommandHandler(ICommandMediator mediator) | ||
: base(mediator) | ||
{ | ||
return; | ||
} | ||
|
||
/// <summary> | ||
/// Releases all resources consumed by the current <see cref="DeleteDomainModelCommandHandler" />. | ||
/// </summary> | ||
/// <param name="disposing"> | ||
/// A value indicating whether or not managed resources should be released. | ||
/// </param> | ||
protected override void Dispose(Boolean disposing) => base.Dispose(disposing); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...e.Domain.AccessControl/CommandHandlers/ModelState/User/UpdateDomainModelCommandHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.User.AggregateDataAccessModel; | ||
using DomainModel = RapidField.SolidInstruments.Example.Domain.Models.User.DomainModel; | ||
using DomainModelCommand = RapidField.SolidInstruments.Example.Domain.Commands.ModelState.User.UpdateDomainModelCommand; | ||
|
||
namespace RapidField.SolidInstruments.Example.Domain.AccessControl.CommandHandlers.ModelState.User | ||
{ | ||
/// <summary> | ||
/// Processes a single <see cref="DomainModelCommand" />. | ||
/// </summary> | ||
public sealed class UpdateDomainModelCommandHandler : UpdateDomainModelCommandHandler<Guid, DomainModel, DataAccessModel, DomainModelCommand> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="UpdateDomainModelCommandHandler" /> class. | ||
/// </summary> | ||
/// <param name="mediator"> | ||
/// A processing intermediary that is used to process sub-commands. | ||
/// </param> | ||
/// <exception cref="ArgumentNullException"> | ||
/// <paramref name="mediator" /> is <see langword="null" />. | ||
/// </exception> | ||
public UpdateDomainModelCommandHandler(ICommandMediator mediator) | ||
: base(mediator) | ||
{ | ||
return; | ||
} | ||
|
||
/// <summary> | ||
/// Releases all resources consumed by the current <see cref="UpdateDomainModelCommandHandler" />. | ||
/// </summary> | ||
/// <param name="disposing"> | ||
/// A value indicating whether or not managed resources should be released. | ||
/// </param> | ||
protected override void Dispose(Boolean disposing) => base.Dispose(disposing); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
example/RapidField.SolidInstruments.Example.Domain.AccessControl/EventHandlerModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// ================================================================================================================================= | ||
// 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.EventAuthoring.DotNetNative; | ||
using System; | ||
|
||
namespace RapidField.SolidInstruments.Example.Domain.AccessControl | ||
{ | ||
/// <summary> | ||
/// Encapsulates container configuration for access control domain event handlers. | ||
/// </summary> | ||
public sealed class EventHandlerModule : DotNetNativeEventHandlerModule | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="EventHandlerModule" /> class. | ||
/// </summary> | ||
/// <param name="applicationConfiguration"> | ||
/// Configuration information for the application. | ||
/// </param> | ||
/// <exception cref="ArgumentNullException"> | ||
/// <paramref name="applicationConfiguration" /> is <see langword="null" />. | ||
/// </exception> | ||
public EventHandlerModule(IConfiguration applicationConfiguration) | ||
: base(applicationConfiguration) | ||
{ | ||
return; | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
...mple.Domain.AccessControl/EventHandlers/ModelState/User/DomainModelCreatedEventHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.User.DomainModel; | ||
using DomainModelEvent = RapidField.SolidInstruments.Example.Domain.Events.ModelState.User.DomainModelCreatedEvent; | ||
|
||
namespace RapidField.SolidInstruments.Example.Domain.AccessControl.EventHandlers.ModelState.User | ||
{ | ||
/// <summary> | ||
/// Processes a single <see cref="DomainModelEvent" />. | ||
/// </summary> | ||
public sealed class DomainModelCreatedEventHandler : DomainModelCreatedEventHandler<DomainModel, DomainModelEvent> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DomainModelCreatedEventHandler" /> class. | ||
/// </summary> | ||
/// <param name="mediator"> | ||
/// A processing intermediary that is used to process sub-commands. | ||
/// </param> | ||
/// <exception cref="ArgumentNullException"> | ||
/// <paramref name="mediator" /> is <see langword="null" />. | ||
/// </exception> | ||
public DomainModelCreatedEventHandler(ICommandMediator mediator) | ||
: base(mediator) | ||
{ | ||
return; | ||
} | ||
|
||
/// <summary> | ||
/// Releases all resources consumed by the current <see cref="DomainModelCreatedEventHandler" />. | ||
/// </summary> | ||
/// <param name="disposing"> | ||
/// A value indicating whether or not managed resources should be released. | ||
/// </param> | ||
protected override void Dispose(Boolean disposing) => base.Dispose(disposing); | ||
|
||
/// <summary> | ||
/// Processes the specified domain model. | ||
/// </summary> | ||
/// <param name="model"> | ||
/// The model that was created. | ||
/// </param> | ||
/// <param name="labels"> | ||
/// A collection of textual labels that provide categorical and/or contextual information about the event. | ||
/// </param> | ||
/// <param name="correlationIdentifier"> | ||
/// A unique identifier to assign to sub-commands. | ||
/// </param> | ||
/// <param name="mediator"> | ||
/// A processing intermediary that is used to process sub-commands. | ||
/// </param> | ||
/// <param name="controlToken"> | ||
/// A token that represents and manages contextual thread safety. | ||
/// </param> | ||
protected override void Process(DomainModel model, IEnumerable<String> labels, Guid correlationIdentifier, ICommandMediator mediator, IConcurrencyControlToken controlToken) => Console.WriteLine($"A user was created (identifier: {model?.Identifier.ToSerializedString()})."); | ||
} | ||
} |
Oops, something went wrong.