9 Commits
1.0.1 ... 1.1.3

6 changed files with 42 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
next-version: 1.0.1
next-version: 1.1.0
mode: ContinuousDeployment
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch

View File

@@ -4,8 +4,8 @@ on:
push:
branches:
- "main"
#paths:
#- "TimetableDesigner.Backend.Events**"
paths:
- "TimetableDesigner.Backend.Events**"
jobs:
build:

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Mateusz Skoczek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -2,7 +2,16 @@
namespace TimetableDesigner.Backend.Events;
public abstract class EventQueue
public abstract class EventQueue<TSelf> where TSelf : EventQueue<TSelf>
{
public abstract void Setup(IServiceCollection services);
public void Setup<TBuilder>(IServiceCollection services, TBuilder configuration)
where TBuilder : EventQueueBuilder<TSelf> =>
Setup(services, configuration.GetConnectionParameters());
public void Setup(IServiceCollection services, string connectionString)
=> Setup(services, connectionString.Split(';')
.Select(x => x.Split('='))
.ToDictionary(x => x.First(), x => x.Last()));
protected abstract void Setup(IServiceCollection services, IDictionary<string, string> connectionParameters);
}

View File

@@ -0,0 +1,6 @@
namespace TimetableDesigner.Backend.Events;
public abstract class EventQueueBuilder<TQueue> where TQueue : EventQueue<TQueue>
{
public abstract IDictionary<string, string> GetConnectionParameters();
}

View File

@@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<Title>TimetableDesigner.Backend.Events</Title>
<Authors>Mateusz Skoczek</Authors>
<PackageProjectUrl>https://github.com/TimetableDesigner/</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TimetableDesigner</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>https://github.com/TimetableDesigner/TimetableDesigner.Backend.Events</RepositoryUrl>
</PropertyGroup>