-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d963b55
commit f548294
Showing
95 changed files
with
139 additions
and
2,692 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
2 changes: 1 addition & 1 deletion
2
.../workflows/reflection-events-labeler.yaml → .github/workflows/cqs-labeler.yaml
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: reflection-events-labeler | ||
name: cqs-labeler | ||
|
||
on: | ||
- pull_request_target | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.9.34728.123 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuerySegregation", "src\CommandQuerySegregation\CommandQuerySegregation.csproj", "{F5FF47B8-A0CC-4F20-A848-AEEF51D4C2C7}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3D12BBC8-E962-4230-AA5F-C97BDCB7AB24}" | ||
ProjectSection(SolutionItems) = preProject | ||
.editorconfig = .editorconfig | ||
Directory.Build.props = Directory.Build.props | ||
Directory.Build.targets = Directory.Build.targets | ||
Directory.Packages.props = Directory.Packages.props | ||
nuget.config = nuget.config | ||
README.md = README.md | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{7A58AE12-65AA-4E1B-B5DB-CBD2732D1AE7}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F5FF47B8-A0CC-4F20-A848-AEEF51D4C2C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F5FF47B8-A0CC-4F20-A848-AEEF51D4C2C7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F5FF47B8-A0CC-4F20-A848-AEEF51D4C2C7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F5FF47B8-A0CC-4F20-A848-AEEF51D4C2C7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {B017BA78-67A5-4D0F-92A3-671B0D8A2911} | ||
EndGlobalSection | ||
EndGlobal |
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 |
---|---|---|
@@ -1,36 +1,36 @@ | ||
# ✨ Contributing to the ReflectionEventing | ||
# ✨ Contributing to the CommandQuerySegregation | ||
|
||
Thank you for exhibiting interest in contributing to the ReflectionEventing. The team is delighted to welcome you onboard to our exciting and growing project. Any contribution or value added go a long way to enhance the project! | ||
Thank you for exhibiting interest in contributing to the CommandQuerySegregation. The team is delighted to welcome you onboard to our exciting and growing project. Any contribution or value added go a long way to enhance the project! | ||
|
||
In the next few steps, you will be able to see a glimpse of ways you can contribute to the ReflectionEventing. | ||
In the next few steps, you will be able to see a glimpse of ways you can contribute to the CommandQuerySegregation. | ||
|
||
## ❔ Questions <a name="question"></a> | ||
|
||
Due to the high volume of incoming issues please keep our GitHub issues for bug reports and feature requests. For general questions, there is a higher chance of getting your question answered on [StackOverflow](https://stackoverflow.com/questions/tagged/lepo-reflection-eventing) where questions should be tagged with the tag `lepo-reflection-eventing`. | ||
Due to the high volume of incoming issues please keep our GitHub issues for bug reports and feature requests. For general questions, there is a higher chance of getting your question answered on [StackOverflow](https://stackoverflow.com/questions/tagged/lepo-cqs) where questions should be tagged with the tag `lepo-cqs`. | ||
|
||
## 🐛 Fix a Bug <a name="bug"></a> | ||
|
||
If you find any bug, you can help the community by [submitting an issue](https://github.com/lepoco/reflectioneventing/issues/new?labels=bug+:bug:&title=[Bug]). Once the issue is filed, feel free to start working on the PR and submit a PR. | ||
If you find any bug, you can help the community by [submitting an issue](https://github.com/lepoco/cqs/issues/new?labels=bug+:bug:&title=[Bug]). Once the issue is filed, feel free to start working on the PR and submit a PR. | ||
|
||
## 👌 Good First Issue <a name="issue"></a> | ||
|
||
If this is your first time contributing to the ReflectionEventing (_WCT_) and do not have advanced level programming experience, we have got you covered 💥 WCT has a list of [good first issue](https://github.com/lepoco/reflectioneventing/labels/good%20first%20issue) that can be a great entryway to find and fix any issues that best fit your expertise or technical background. | ||
If this is your first time contributing to the CommandQuerySegregation (_WCT_) and do not have advanced level programming experience, we have got you covered 💥 WCT has a list of [good first issue](https://github.com/lepoco/cqs/labels/good%20first%20issue) that can be a great entryway to find and fix any issues that best fit your expertise or technical background. | ||
|
||
## 🙋 Help Wanted <a name="help"></a> | ||
|
||
WCT also has a list of issues that are labeled as [help wanted](https://github.com/lepoco/reflectioneventing/labels/help%20wanted). The level of complexity in the list can vary but if you have an advanced level of programming experience, feel free to jump in to solve these issues. | ||
WCT also has a list of issues that are labeled as [help wanted](https://github.com/lepoco/cqs/labels/help%20wanted). The level of complexity in the list can vary but if you have an advanced level of programming experience, feel free to jump in to solve these issues. | ||
|
||
## 📬 Add New Feature <a name="feature"></a> | ||
|
||
* To contribute a new feature, fill out the [Feature Request Template](https://github.com/lepoco/reflectioneventing/issues/new?template=feature_request.md&labels=feature+request+:mailbox_with_mail:&title=[Feature]) and provide detailed information to express the proposal. | ||
* To contribute a new feature, fill out the [Feature Request Template](https://github.com/lepoco/cqs/issues/new?template=feature_request.md&labels=feature+request+:mailbox_with_mail:&title=[Feature]) and provide detailed information to express the proposal. | ||
* Once the Feature Request is submitted, it will be open for discussion. | ||
* If it gets approved by the team, proceed to submit a PR of the proposed Feature. | ||
* If the PR contains an error-free code and the reviewer signs off, the PR will be merged. | ||
|
||
## 🚀 Create, Submit or Review Pull Request <a name="pr"></a> | ||
|
||
Anyone can create a Pull Request by forking the ReflectionEventing Repository. Here is how you can [Create a Pull Request from fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork). Once you fork the ReflectionEventing repo, it is essential to create all changes in the feature branch of your forked repository. If you have the changes in the forked feature branch, you can then create a Pull Request in the main ReflectionEventing. | ||
Anyone can create a Pull Request by forking the CommandQuerySegregation Repository. Here is how you can [Create a Pull Request from fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork). Once you fork the CommandQuerySegregation repo, it is essential to create all changes in the feature branch of your forked repository. If you have the changes in the forked feature branch, you can then create a Pull Request in the main CommandQuerySegregation. | ||
|
||
## 💙 Thank You | ||
|
||
**Thank you so much for contributing to this amazing project. We hope you will continue to add value and find yourself as a highly reliable source to the ReflectionEventing.** | ||
**Thank you so much for contributing to this amazing project. We hope you will continue to add value and find yourself as a highly reliable source to the CommandQuerySegregation.** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,46 @@ | ||
# 🚎 ReflectionEventing | ||
# 🚎 CommandQuerySegregation | ||
|
||
[Created with ❤ in Poland by lepo.co](https://dev.lepo.co/) | ||
ReflectionEventing is a powerful tool for developers looking to create decoupled designs in WPF, WinForms, or CLI applications. By leveraging the power of Dependency Injection (DI) and eventing, ReflectionEventing promotes better Inversion of Control (IoC), reducing coupling and enhancing the modularity and flexibility of your applications. | ||
Elevate your application's command and query responsibilities. CommandQuerySegregation provides intuitive interfaces and classes for implementing Command Query Responsibility Segregation (CQRS) in .NET applications. It facilitates clear separation of command and query operations, promoting clean architecture and enhanced maintainability. | ||
|
||
[![GitHub license](https://img.shields.io/github/license/lepoco/reflectioneventing)](https://github.com/lepoco/reflectioneventing/blob/master/LICENSE) [![Nuget](https://img.shields.io/nuget/v/ReflectionEventing)](https://www.nuget.org/packages/ReflectionEventing/) [![Nuget](https://img.shields.io/nuget/dt/ReflectionEventing?label=nuget)](https://www.nuget.org/packages/ReflectionEventing/) [![Sponsors](https://img.shields.io/github/sponsors/lepoco)](https://github.com/sponsors/lepoco) | ||
[![GitHub license](https://img.shields.io/github/license/lepoco/cqs)](https://github.com/lepoco/cqs/blob/master/LICENSE) [![Nuget](https://img.shields.io/nuget/v/CommandQuerySegregation)](https://www.nuget.org/packages/CommandQuerySegregation/) [![Nuget](https://img.shields.io/nuget/dt/CommandQuerySegregation?label=nuget)](https://www.nuget.org/packages/CommandQuerySegregation/) [![Sponsors](https://img.shields.io/github/sponsors/lepoco)](https://github.com/sponsors/lepoco) | ||
|
||
## 👀 What does this repo contain? | ||
|
||
This repository houses the source code for the ReflectionEventing NuGet package. The package utilizes C# reflection to register services that can listen for and respond to local events. | ||
This repository houses the source code for the CommandQuerySegregation NuGet package. | ||
|
||
## Gettings started | ||
|
||
ReflectionEventing is available as NuGet package on NuGet.org: | ||
https://www.nuget.org/packages/ReflectionEventing | ||
https://www.nuget.org/packages/ReflectionEventing.Autofac | ||
https://www.nuget.org/packages/ReflectionEventing.Castle.Windsor | ||
https://www.nuget.org/packages/ReflectionEventing.DependencyInjection | ||
https://www.nuget.org/packages/ReflectionEventing.Ninject | ||
https://www.nuget.org/packages/ReflectionEventing.Unity | ||
CommandQuerySegregation is available as NuGet package on NuGet.org: | ||
https://www.nuget.org/packages/CommandQuerySegregation | ||
|
||
You can add it to your project using .NET CLI: | ||
|
||
```powershell | ||
dotnet add package ReflectionEventing.DependencyInjection | ||
dotnet add package CommandQuerySegregation | ||
``` | ||
|
||
, or package manager console: | ||
|
||
```powershell | ||
NuGet\Install-Package ReflectionEventing.DependencyInjection | ||
NuGet\Install-Package CommandQuerySegregation | ||
``` | ||
|
||
### 🛠️ How to Use ReflectionEventing | ||
|
||
#### 1. Register Consumers and the Event Bus | ||
|
||
In this step, we register our ViewModel as a singleton and add it as a consumer to the event bus. This allows the ViewModel to listen for events published on the bus. | ||
|
||
```csharp | ||
IHost host = Host.CreateDefaultBuilder() | ||
.ConfigureServices((context, services) => | ||
{ | ||
services.AddSingleton<MainWindowViewModel>(); | ||
services.AddEventBus(e => | ||
{ | ||
e.AddConsumer<MainWindowViewModel>(); | ||
}); | ||
} | ||
) | ||
.Build(); | ||
``` | ||
|
||
#### 2. Publish Events | ||
|
||
Here, we create a background service that publishes an event on the event bus. This event could be anything - in this case, we're publishing a `BackgroundTicked` event. | ||
|
||
```csharp | ||
public class MyBackgroundService(IEventBus eventBus) | ||
{ | ||
public void PublishEvent() | ||
{ | ||
eventBus.Publish(new BackgroundTicked()); | ||
} | ||
} | ||
``` | ||
|
||
#### 3. Listen for Events | ||
|
||
Finally, we implement the `IConsumer<T>` interface in our ViewModel. This allows the ViewModel to consume `BackgroundTicked` events. When a `BackgroundTicked` event is published, the `ConsumeAsync` method is called, and we update the `CurrentTick` property. | ||
|
||
```csharp | ||
public partial class MainWindowViewModel : ObservableObject, IConsumer<BackgroundTicked> | ||
{ | ||
[ObservableProperty] | ||
private int _currentTick = 0; | ||
|
||
public Task ConsumeAsync(BackgroundTicked payload, CancellationToken cancellationToken) | ||
{ | ||
CurrentTick = payload.Value; | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
``` | ||
### 🛠️ How to Use CommandQuerySegregation | ||
tba | ||
|
||
## Compilation | ||
|
||
To build the project, use Visual Studio 2022 and open the .sln file. | ||
|
||
Visual Studio | ||
**ReflectionEventing** is an Open Source project. You are entitled to download and use the freely available Visual Studio Community Edition to build, run or develop for ReflectionEventing. As per the Visual Studio Community Edition license, this applies regardless of whether you are an individual or a corporate user. | ||
**CommandQuerySegregation** is an Open Source project. You are entitled to download and use the freely available Visual Studio Community Edition to build, run or develop for CommandQuerySegregation. As per the Visual Studio Community Edition license, this applies regardless of whether you are an individual or a corporate user. | ||
|
||
## Code of Conduct | ||
|
||
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. | ||
|
||
## License | ||
|
||
**ReflectionEventing** is free and open source software licensed under **MIT License**. You can use it in private and commercial projects. | ||
**CommandQuerySegregation** is free and open source software licensed under **MIT License**. You can use it in private and commercial projects. | ||
Keep in mind that you must include a copy of the license in your project. |
Oops, something went wrong.