Skip to content

Commit

Permalink
Revert "Prepare repo"
Browse files Browse the repository at this point in the history
This reverts commit f548294.
  • Loading branch information
pomianowski committed Jun 10, 2024
1 parent f548294 commit 108b058
Show file tree
Hide file tree
Showing 95 changed files with 2,692 additions and 139 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 CommandQuerySegregation 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 ReflectionEventing 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/CommandQuerySegregation/**', 'src/Directory.Packages.props' ]
- any-glob-to-any-file: [ 'src/ReflectionEventing/**', 'src/Directory.Packages.props' ]

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

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

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

- name: Run tests
run: dotnet test CommandQuerySegregation.sln --configuration Release --no-restore --no-build --verbosity quiet
run: dotnet test ReflectionEventing.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: cqs-labeler
name: reflection-events-labeler

on:
- pull_request_target
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cqs-pr-validator
name: reflection-events-pr-validator

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

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

- name: Run tests
run: dotnet test CommandQuerySegregation.sln --configuration Release --no-restore --no-build --verbosity quiet
run: dotnet test ReflectionEventing.sln --configuration Release --no-restore --no-build --verbosity quiet
37 changes: 0 additions & 37 deletions CommandQuerySegregation.sln

This file was deleted.

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 CommandQuerySegregation
# ✨ Contributing to the ReflectionEventing

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!
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!

In the next few steps, you will be able to see a glimpse of ways you can contribute to the CommandQuerySegregation.
In the next few steps, you will be able to see a glimpse of ways you can contribute to the ReflectionEventing.

## ❔ 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-cqs) where questions should be tagged with the tag `lepo-cqs`.
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`.

## 🐛 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/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.
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.

## 👌 Good First Issue <a name="issue"></a>

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.
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.

## 🙋 Help Wanted <a name="help"></a>

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.
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.

## 📬 Add New Feature <a name="feature"></a>

* 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.
* 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.
* 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 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.
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.

## 💙 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 CommandQuerySegregation.**
**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.**
13 changes: 6 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@
</PropertyGroup>

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

<PropertyGroup>
<Company>lepo.co</Company>
<Authors>lepo.co</Authors>
<Product>CommandQuerySegregation</Product>
<CommonTags>lepoco;commands;queries;bus;messages</CommonTags>
<Product>ReflectionEventing</Product>
<CommonTags>lepoco;events;eventing;reflection;client;toolkit;extensions;bus;eventbus;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/cqs</PackageProjectUrl>
<PackageReleaseNotes>https://github.com/lepoco/cqs/releases</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/lepoco/reflectioneventing</PackageProjectUrl>
<PackageReleaseNotes>https://github.com/lepoco/reflectioneventing/releases</PackageReleaseNotes>
<PackageIcon>Icon.png</PackageIcon>
<PackageIconUrl>https://github.com/lepoco/cqs/main/build/nuget.png</PackageIconUrl>
<PackageIconUrl>https://github.com/lepoco/reflectioneventing/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 CommandQuerySegregation Contributors. https://dev.lepo.co/
Copyright (c) 2024 Leszek Pomianowski and ReflectionEventing 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 CommandQuerySegregation Contributors. https://dev.lepo.co/
Copyright (c) 2024 Leszek Pomianowski and ReflectionEventing 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: 67 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,101 @@
# 🚎 CommandQuerySegregation
# 🚎 ReflectionEventing

[Created with ❤ in Poland by lepo.co](https://dev.lepo.co/)
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.
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.

[![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)
[![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)

## 👀 What does this repo contain?

This repository houses the source code for the CommandQuerySegregation NuGet package.
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.

## Gettings started

CommandQuerySegregation is available as NuGet package on NuGet.org:
https://www.nuget.org/packages/CommandQuerySegregation
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

You can add it to your project using .NET CLI:

```powershell
dotnet add package CommandQuerySegregation
dotnet add package ReflectionEventing.DependencyInjection
```

, or package manager console:

```powershell
NuGet\Install-Package CommandQuerySegregation
NuGet\Install-Package ReflectionEventing.DependencyInjection
```

### 🛠️ How to Use CommandQuerySegregation
tba
### 🛠️ 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;
}
}
```

## Compilation

To build the project, use Visual Studio 2022 and open the .sln file.

Visual Studio
**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.
**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.

## Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.

## License

**CommandQuerySegregation** is free and open source software licensed under **MIT License**. You can use it in private and commercial projects.
**ReflectionEventing** 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 108b058

Please sign in to comment.