-
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 user role example models.
- Loading branch information
1 parent
9b305c7
commit 1cca248
Showing
82 changed files
with
2,878 additions
and
41 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
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
43 changes: 43 additions & 0 deletions
43
example/RapidField.SolidInstruments.Example.BeaconService/ApplicationDependencyPackage.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,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 | ||
{ | ||
/// <summary> | ||
/// Encapsulates container configuration for the application. | ||
/// </summary> | ||
public class ApplicationDependencyPackage : DotNetNativeDependencyPackage | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ApplicationDependencyPackage" /> class. | ||
/// </summary> | ||
public ApplicationDependencyPackage() | ||
: base() | ||
{ | ||
return; | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new collection of dependency modules for the package. | ||
/// </summary> | ||
/// <param name="applicationConfiguration"> | ||
/// Configuration information for the application. | ||
/// </param> | ||
/// <returns> | ||
/// The package's dependency modules. | ||
/// </returns> | ||
protected override IEnumerable<IDependencyModule<ServiceCollection>> CreateModules(IConfiguration applicationConfiguration) => new IDependencyModule<ServiceCollection>[] | ||
{ | ||
new ServiceBusDependencyModule(applicationConfiguration), | ||
new MessageHandlerModule(applicationConfiguration) | ||
}; | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
example/RapidField.SolidInstruments.Example.BeaconService/ApplicationServiceExecutor.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 Microsoft.Extensions.Configuration; | ||
using RapidField.SolidInstruments.Messaging.DotNetNative.Service; | ||
using System; | ||
using System.IO; | ||
|
||
namespace RapidField.SolidInstruments.Example.BeaconService | ||
{ | ||
/// <summary> | ||
/// Prepares for and performs execution of the beacon service. | ||
/// </summary> | ||
public sealed class ApplicationServiceExecutor : DotNetNativeBeaconServiceExecutor<ApplicationDependencyPackage> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ApplicationServiceExecutor" /> class. | ||
/// </summary> | ||
public ApplicationServiceExecutor() | ||
: base(true, false, false, false, false) | ||
{ | ||
return; | ||
} | ||
|
||
/// <summary> | ||
/// Builds the application configuration for the service. | ||
/// </summary> | ||
/// <param name="configurationBuilder"> | ||
/// An object that is used to build the configuration. | ||
/// </param> | ||
protected override void BuildConfiguration(IConfigurationBuilder configurationBuilder) | ||
{ | ||
try | ||
{ | ||
configurationBuilder.SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json"); | ||
} | ||
finally | ||
{ | ||
base.BuildConfiguration(configurationBuilder); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Releases all resources consumed by the current <see cref="ApplicationServiceExecutor" />. | ||
/// </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> | ||
/// When overridden by a derived class, gets a copyright notice which is written to the console at the start of service | ||
/// execution. | ||
/// </summary> | ||
protected override sealed String CopyrightNotice => "Copyright (c) RapidField LLC. All rights reserved."; | ||
|
||
/// <summary> | ||
/// 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. | ||
/// </summary> | ||
protected override sealed String ProductName => "Solid Instruments"; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
example/RapidField.SolidInstruments.Example.BeaconService/Program.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,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 | ||
{ | ||
/// <summary> | ||
/// Houses the entry point for the application. | ||
/// </summary> | ||
public static class Program | ||
{ | ||
/// <summary> | ||
/// Begins execution of the application. | ||
/// </summary> | ||
/// <param name="args"> | ||
/// Command line arguments that are provided at runtime. | ||
/// </param> | ||
public static void Main(String[] args) | ||
{ | ||
using var serviceExecutor = new ApplicationServiceExecutor(); | ||
serviceExecutor.Execute(args); | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...nstruments.Example.BeaconService/RapidField.SolidInstruments.Example.BeaconService.csproj
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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information. | ||
--> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Authors>Solid Instruments contributors</Authors> | ||
<Company>RapidField</Company> | ||
<Copyright>Copyright (c) RapidField LLC. All rights reserved.</Copyright> | ||
<Product>Solid Instruments</Product> | ||
<Description>This project demonstrates a beacon service application utilizing Solid Instruments constructs.</Description> | ||
<Version>$(BuildVersion)</Version> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<DocumentationFile>bin\Debug\netcoreapp3.1\RapidField.SolidInstruments.Example.BeaconService.xml</DocumentationFile> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<WarningsAsErrors /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<DocumentationFile>bin\Release\netcoreapp3.1\RapidField.SolidInstruments.Example.BeaconService.xml</DocumentationFile> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<WarningsAsErrors /> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Remove="appsettings.json" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="..\..\LICENSE.txt" Link="LICENSE.txt" /> | ||
<Content Include="appsettings.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.7" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\RapidField.SolidInstruments.Example.Domain\RapidField.SolidInstruments.Example.Domain.csproj" /> | ||
</ItemGroup> | ||
</Project> |
15 changes: 15 additions & 0 deletions
15
example/RapidField.SolidInstruments.Example.BeaconService/appsettings.json
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,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" | ||
} | ||
} | ||
} |
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
Oops, something went wrong.