Skip to content

Commit

Permalink
Prepare repo
Browse files Browse the repository at this point in the history
  • Loading branch information
pomianowski committed Jun 10, 2024
1 parent d963b55 commit f548294
Show file tree
Hide file tree
Showing 95 changed files with 139 additions and 2,692 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ insert_final_newline = true
[*.cs]

#### File Header Template ####
file_header_template = This Source Code Form is subject to the terms of the MIT License.\nIf a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.\nCopyright (C) Leszek Pomianowski and ReflectionEventing Contributors.\nAll Rights Reserved.
file_header_template = This Source Code Form is subject to the terms of the MIT License.\nIf a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.\nCopyright (C) Leszek Pomianowski and CommandQuerySegregation Contributors.\nAll Rights Reserved.

#### .NET Coding Conventions ####

Expand Down
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ update:

NuGet:
- changed-files:
- any-glob-to-any-file: [ 'src/ReflectionEventing/**', 'src/Directory.Packages.props' ]
- any-glob-to-any-file: [ 'src/CommandQuerySegregation/**', 'src/Directory.Packages.props' ]

dependencies:
- changed-files:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: reflection-events-client-cd-nuget
name: cqs-cd-nuget

on:
push:
Expand Down Expand Up @@ -26,10 +26,10 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build ReflectionEventing.sln --configuration Release --no-restore -p:SourceLinkEnabled=true
run: dotnet build CommandQuerySegregation.sln --configuration Release --no-restore -p:SourceLinkEnabled=true

- name: Run tests
run: dotnet test ReflectionEventing.sln --configuration Release --no-restore --no-build --verbosity quiet
run: dotnet test CommandQuerySegregation.sln --configuration Release --no-restore --no-build --verbosity quiet

- name: Publish the package to NuGet.org
run: nuget push **\*.nupkg -NonInteractive -SkipDuplicate -Source 'https://api.nuget.org/v3/index.json'
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: reflection-events-pr-validator
name: cqs-pr-validator

on:
pull_request:
Expand Down Expand Up @@ -29,7 +29,7 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build ReflectionEventing.sln --configuration Release --no-restore
run: dotnet build CommandQuerySegregation.sln --configuration Release --no-restore

- name: Run tests
run: dotnet test ReflectionEventing.sln --configuration Release --no-restore --no-build --verbosity quiet
run: dotnet test CommandQuerySegregation.sln --configuration Release --no-restore --no-build --verbosity quiet
37 changes: 37 additions & 0 deletions CommandQuerySegregation.sln
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
20 changes: 10 additions & 10 deletions Contributing.md
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.**
13 changes: 7 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
</PropertyGroup>

<PropertyGroup>
<Version>3.0.1</Version>
<Version>1.0.0</Version>
<PackageVersion>1.0.0-preview.1</PackageVersion>
</PropertyGroup>

<PropertyGroup>
<Company>lepo.co</Company>
<Authors>lepo.co</Authors>
<Product>ReflectionEventing</Product>
<CommonTags>lepoco;events;eventing;reflection;client;toolkit;extensions;bus;eventbus;messages</CommonTags>
<Product>CommandQuerySegregation</Product>
<CommonTags>lepoco;commands;queries;bus;messages</CommonTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Copyright>(c) lepo.co | Leszek Pomianowski and Contributors. All rights reserved.</Copyright>
<PackageProjectUrl>https://github.com/lepoco/reflectioneventing</PackageProjectUrl>
<PackageReleaseNotes>https://github.com/lepoco/reflectioneventing/releases</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/lepoco/cqs</PackageProjectUrl>
<PackageReleaseNotes>https://github.com/lepoco/cqs/releases</PackageReleaseNotes>
<PackageIcon>Icon.png</PackageIcon>
<PackageIconUrl>https://github.com/lepoco/reflectioneventing/main/build/nuget.png</PackageIconUrl>
<PackageIconUrl>https://github.com/lepoco/cqs/main/build/nuget.png</PackageIconUrl>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Leszek Pomianowski and ReflectionEventing Contributors. https://dev.lepo.co/
Copyright (c) 2024 Leszek Pomianowski and CommandQuerySegregation Contributors. https://dev.lepo.co/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Leszek Pomianowski and ReflectionEventing Contributors. https://dev.lepo.co/
Copyright (c) 2024 Leszek Pomianowski and CommandQuerySegregation Contributors. https://dev.lepo.co/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
79 changes: 12 additions & 67 deletions README.md
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.
Loading

0 comments on commit f548294

Please sign in to comment.