Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from kurmann/main
Browse files Browse the repository at this point in the history
mege main branch
  • Loading branch information
kurmann authored Apr 6, 2024
2 parents 6d1a399 + dd557e3 commit bc600cb
Show file tree
Hide file tree
Showing 30 changed files with 344 additions and 187 deletions.
385 changes: 261 additions & 124 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<!-- Die Version sollte mit jeder Veröffentlichung auf Nuget.org erhöht werden. Die Release Notes dürfen Umbrüche
enthalten, jedoch keine spezifischen Markdown-Formatierungen wie fett oder kursiv oder Überschriften -->
<PackageVersion>1.10.0-beta</PackageVersion>
<PackageReleaseNotes>Integration von UserSecrets, IOptions-Pattern beim SCI-Modul angewandt und ausführlich dokumentiert.
<PackageVersion>1.11.0-beta</PackageVersion>
<PackageReleaseNotes>Umbenennung aller Vorlagen mit Fokus auf "Kurmann.Videoschnitt". Einheitliche Namensgebung.
</PackageReleaseNotes>

<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
22 changes: 22 additions & 0 deletions Templates.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Templates", "Templates.csproj", "{09299963-E1A4-4A58-B0A7-7AD8F1779A16}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{09299963-E1A4-4A58-B0A7-7AD8F1779A16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09299963-E1A4-4A58-B0A7-7AD8F1779A16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09299963-E1A4-4A58-B0A7-7AD8F1779A16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09299963-E1A4-4A58-B0A7-7AD8F1779A16}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
8 changes: 0 additions & 8 deletions templates/scimodule/Module/ModuleSettings.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"$schema": "http://json.schemastore.org/template",
"author": "Patrick Kurmann",
"classifications": [
"Common",
"GitHubActions"
"Kurmann",
"Videoschnitt",
"GitHub"
],
"identity": "Kurmann.Videoschnitt.EntityLib.GitHubWorkfow",
"name": "Entity Library GitHub Workflow",
"shortName": "entitylib-github-workflow",
"name": "Videoschnitt Entity Library GitHub Workflow",
"shortName": "videoschnitt-entitylib-wf",
"sourceName": "EntityLib.GitHubWorkfow",
"description": "Creates a GitHub Actions workflow for publishing a entity library to NuGet.org.",
"description": "Creates a GitHub Actions workflow for publishing a entity library to NuGet.org for the Kurmann.Videoschnitt namespace.",
"tags": {
"language": "YAML",
"type": "item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"$schema": "http://json.schemastore.org/template",
"author": "Patrick Kurmann",
"classifications": [
"Common",
"Kurmann",
"Videoschnitt",
"ClassLibrary"
],
"identity": "Kurmann.Videoschnitt.EntityLib",
"name": "Entity Library",
"shortName": "entitylib",
"name": "Videoschnitt Entity Library",
"shortName": "videoschnitt-entitylib",
"sourceName": "EntityLib",
"description": ".NET Class-Library template for domain logic with an associated test project, using C# Functional Extensions for Result types.",
"description": "A .NET Class-Library template for domain logic with an associated test project, using C# Functional Extensions for Result types for the Kurmann.Videoschnitt namespace.",
"tags": {
"language": "C#",
"type": "solution"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Kurmann.Videoschnitt.EntityLib;

namespace Kurmann.Videoschnitt.EntityLib.Tests.Entities;
namespace Kurmann.Videoschnitt.EntityLib.Tests;

[TestClass]
public class SampleEntityTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"$schema": "http://json.schemastore.org/template",
"author": "Patrick Kurmann",
"classifications": [
"Common",
"VsCode",
"DebugConfig"
"Kurmann",
"Videoschnitt",
"Debug"
],
"identity": "Kurmann.Videoschnitt.SciModule.VsCode.DebugConfig",
"name": "SCI Module VS Code Debug Config",
"shortName": "scimodule-vscode-debugconfig",
"sourceName": "SciModule.VsCode.DebugConfig",
"description": "This template creates the Visual Studio Code debug configuration for the Service Collection Integrated Module.",
"identity": "Kurmann.Videoschnitt.Module.Debug",
"name": "Videoschnitt Module VS Code Debug Config",
"shortName": "videoschnitt-module-debug",
"sourceName": "ModuleName",
"description": "This template creates the Visual Studio Code debug configuration for Kurmann Videoschnitt module.",
"tags": {
"language": "JSON",
"type": "item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Application/bin/Debug/net8.0/Kurmann.Videoschnitt.SciModule.VsCode.DebugConfig.Application.dll",
"program": "${workspaceFolder}/src/Application/bin/Debug/net8.0/Kurmann.Videoschnitt.ModuleName.Application.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ jobs:

- name: Restore dependencies for Module
run: dotnet restore src/Module/Module.csproj

# Optional: Ausführen der Tests
# - name: Test
# run: dotnet test src/Tests/Tests.csproj --no-build --verbosity normal

- name: Pack Module
run: dotnet pack src/Module/Module.csproj --output ./nupkgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"$schema": "http://json.schemastore.org/template",
"author": "Patrick Kurmann",
"classifications": [
"Common",
"GitHubActions"
"Kurmann",
"Videoschnitt",
"GitHub"
],
"identity": "Kurmann.Videoschnitt.SciModule.GitHubWorkfow",
"name": "SCI Module GitHub Workflow",
"shortName": "scimodule-github-workflow",
"sourceName": "SciModule.GitHubWorkfow",
"description": "Creates a GitHub Actions workflow for publishing a Service Collection Integrated Module to NuGet.org.",
"identity": "Kurmann.Videoschnitt.Module.GitHubWorkfow",
"name": "Videoschnitt Module GitHub Workflow",
"shortName": "videoschnitt-module-wf",
"sourceName": "ModuleName",
"description": "Creates a GitHub Actions workflow for publishing a Videoschnitt Module to NuGet.org.",
"tags": {
"language": "YAML",
"type": "item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"$schema": "http://json.schemastore.org/template",
"author": "Patrick Kurmann",
"classifications": [
"Common",
"Kurmann",
"Videoschnitt",
"ServiceCollection"
],
"identity": "Kurmann.Videoschnitt.ServiceCollectionIntegratedModule",
"name": "SCI Module",
"shortName": "scimodule",
"sourceName": "ServiceCollectionIntegratedModule",
"identity": "Kurmann.Videoschnitt.Module",
"name": "Videoschnitt Module",
"shortName": "videoschnitt-module",
"sourceName": "ModuleName",
"description": "Module with Application, Entities, Module and Test project for the Videoschnitt modular monolith architecture.",
"tags": {
"language": "C#",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Kurmann.Videoschnitt.ServiceCollectionIntegratedModule.Application.</RootNamespace>
<AssemblyName>Kurmann.Videoschnitt.ServiceCollectionIntegratedModule.Application</AssemblyName>
<RootNamespace>Kurmann.Videoschnitt.ModuleName.Application.</RootNamespace>
<AssemblyName>Kurmann.Videoschnitt.ModuleName.Application</AssemblyName>
<IsPackable>false</IsPackable>
<Version>1.0.0</Version>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;

namespace Kurmann.Videoschnitt.ServiceCollectionIntegratedModule.Application;
namespace Kurmann.Videoschnitt.ModuleName.Application;

internal class Program
{
Expand All @@ -12,7 +12,7 @@ public static IHostBuilder CreateHostBuilder(string[] args)
return Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((hostingContext, config) =>
{
if (hostingContext.HostingEnvironment.IsDevelopment())
if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Environments.Development)
{
// execute "dotnet user-secrets init" in the project folder to create the secrets.json file
// add specific secrets with "dotnet user-secrets set "Kurmann:Videoschnitt:MikaModule:SampleSetting" "Secret Value""
Expand All @@ -21,7 +21,7 @@ public static IHostBuilder CreateHostBuilder(string[] args)
})
.ConfigureServices((hostContext, services) =>
{
services.AddServiceCollectionIntegratedModule(hostContext.Configuration);
services.AddModuleName(hostContext.Configuration);
});
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CSharpFunctionalExtensions;

namespace Kurmann.Videoschnitt.ServiceCollectionIntegratedModule.Commands;
namespace Kurmann.Videoschnitt.ModuleName.Commands;

public interface ICommand<T>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CSharpFunctionalExtensions;

namespace Kurmann.Videoschnitt.ServiceCollectionIntegratedModule.Commands;
namespace Kurmann.Videoschnitt.ModuleName.Commands;

public class SampleCommand(string? sampleParameter) : ICommand<SampleCommandResult>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<RootNamespace>Kurmann.Videoschnitt.ServiceCollectionIntegratedModule</RootNamespace>
<AssemblyName>Kurmann.Videoschnitt.ServiceCollectionIntegratedModule</AssemblyName>
<PackageId>Kurmann.Videoschnitt.ServiceCollectionIntegratedModule</PackageId>
<RootNamespace>Kurmann.Videoschnitt.ModuleName</RootNamespace>
<AssemblyName>Kurmann.Videoschnitt.ModuleName</AssemblyName>
<PackageId>Kurmann.Videoschnitt.ModuleName</PackageId>

<!-- Package-Tages zur Katalogisierung auf Nuget.org. Mehrere Tags mit Semikolen ";" trennen. -->
<PackageTags>Videoschnitt</PackageTags>
Expand Down
8 changes: 8 additions & 0 deletions templates/videoschnitt-module/Module/ModuleSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Kurmann.Videoschnitt.ModuleName;

public class ModuleSettings
{
public const string SectionName = "Kurmann.Videoschnitt.ModuleName";

public string SampleSetting { get; set; } = "Sample Value";
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CSharpFunctionalExtensions;

namespace Kurmann.Videoschnitt.ServiceCollectionIntegratedModule.Queries;
namespace Kurmann.Videoschnitt.ModuleName.Queries;

public interface IQueryService<T>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CSharpFunctionalExtensions;

namespace Kurmann.Videoschnitt.ServiceCollectionIntegratedModule.Queries;
namespace Kurmann.Videoschnitt.ModuleName.Queries;

public class SampleQuery(string? sampleParameter) : IQueryService<SampleQueryResult>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Microsoft.Extensions.DependencyInjection;
using Kurmann.Videoschnitt.ServiceCollectionIntegratedModule.Services;
using Kurmann.Videoschnitt.ModuleName.Services;
using Microsoft.Extensions.Configuration;

namespace Kurmann.Videoschnitt.ServiceCollectionIntegratedModule;
namespace Kurmann.Videoschnitt.ModuleName;

public static class ServiceCollectionExtensions
{
public static IServiceCollection AddServiceCollectionIntegratedModule(
public static IServiceCollection AddModuleName(
this IServiceCollection services,
IConfiguration configuration)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

namespace Kurmann.Videoschnitt.ServiceCollectionIntegratedModule.Services;
namespace Kurmann.Videoschnitt.ModuleName.Services;

public class SampleHostedService(ILogger<SampleHostedService> logger, IOptionsSnapshot<ModuleSettings> options) : IHostedService, IDisposable
{
Expand Down

0 comments on commit bc600cb

Please sign in to comment.