Skip to content

Commit

Permalink
refactor: run rider reformat and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
the-avid-engineer committed Oct 4, 2021
1 parent d6eb670 commit 3546641
Show file tree
Hide file tree
Showing 225 changed files with 12,316 additions and 11,983 deletions.
21 changes: 11 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
name: Bug report about: Create a report to help us improve title: ''
labels: ''
assignees: ''

Expand All @@ -12,6 +10,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +23,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
name: Custom issue template about: Describe this issue template's purpose here. title: ''
labels: ''
assignees: ''

Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
name: Feature request about: Suggest an idea for this project title: ''
labels: ''
assignees: ''

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:
on:
push:
branches:
- '**'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/create-release-draft.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:
on:
push:
tags:
- '*'
Expand All @@ -12,15 +12,15 @@ jobs:
outputs:
is_semantic_version: ${{ steps.parse.outputs.is_semantic_version }}
is_prerelease: ${{ steps.parse.outputs.is_prerelease }}
steps:
steps:
- id: parse
run: |
# This pattern comes from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
# However, Bash uses POSIX regular expressions, and POSIX does not support non-capturing groups: (?:...)
# To make it compatible, the non-capture modifiers have been removed.
semantic_version_pattern='^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-((0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$'
if [[ ${GITHUB_REF/refs\/tags\//} =~ $semantic_version_pattern ]]; then
echo ::set-output name=is_semantic_version::'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: windows-latest
needs: extract
env:
NOTES: ${{ needs.extract.outputs.notes }}
NOTES: ${{ needs.extract.outputs.notes }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand Down
112 changes: 43 additions & 69 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,124 +2,98 @@

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for
everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity
and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion,
or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:
Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take
appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for
moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
the community in public spaces. Examples of representing our community include using an official e-mail address, posting
via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
the.avid.engineer@outlook.com.
All complaints will be reviewed and investigated promptly and fairly.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible
for enforcement at the.avid.engineer@outlook.com. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem
in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the
community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation
and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including
unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding
interactions in community spaces as well as external channels like social media. Violating these terms may lead to a
temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified
period of time. No public or private interaction with the people involved, including unsolicited interaction with those
enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate
behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
Community Impact Guidelines were inspired
by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

Expand Down
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# EntityDb.NET [![codecov](https://codecov.io/gh/entitydb-io/EntityDb.NET/branch/main/graph/badge.svg?token=2IK4D211SY)](https://codecov.io/gh/entitydb-io/EntityDb.NET) [![CodeFactor](https://www.codefactor.io/repository/github/entitydb-io/entitydb.net/badge)](https://www.codefactor.io/repository/github/entitydb-io/entitydb.net)

At its core, EntityDb.NET is a set of abstractions and implementations for the Event Sourcing pattern, with the added ability to enforce uniqueness constraints and the ability to tag resources.
At its core, EntityDb.NET is a set of abstractions and implementations for the Event Sourcing pattern, with the added
ability to enforce uniqueness constraints and the ability to tag resources.

## What is Event Sourcing?

Event Sourcing centers around the idea that your source of truth is _not_ the current state, it is all of the deltas that add up to the current state. Consider your personal bank - which of these options do you think it their source of truth for account balances?
Event Sourcing centers around the idea that your source of truth is _not_ the current state, it is all of the deltas
that add up to the current state. Consider your personal bank - which of these options do you think it their source of
truth for account balances?

- Option A - Table Rows
- John Doe has $123.45 in Account A
- Jane Doe has $678.90 in Account B
- John Doe has $123.45 in Account A
- Jane Doe has $678.90 in Account B
- Option B - Transactions
- John Doe deposited $100.00 in Account A
- Jane Doe deposited $600.00 in Account B
- John Doe deposited $20.00 in Account A
- Jane Doe deposited $70.00 in Account B
- John Doe deposited $3.45 in Account A
- Jane Doe deposited $8.90 in Account B
- John Doe deposited $100.00 in Account A
- Jane Doe deposited $600.00 in Account B
- John Doe deposited $20.00 in Account A
- Jane Doe deposited $70.00 in Account B
- John Doe deposited $3.45 in Account A
- Jane Doe deposited $8.90 in Account B

The answer is pretty obvious if you go check your bank statement. They keep a set of transactions, and regurgitate that information on the statement. (If I'm wrong, you should consider getting a new bank, ASAP!)
The answer is pretty obvious if you go check your bank statement. They keep a set of transactions, and regurgitate that
information on the statement. (If I'm wrong, you should consider getting a new bank, ASAP!)

## How does EntityDb.NET implement Event Sourcing?

Expand All @@ -29,16 +33,23 @@ There are three core sets of data:

### Sources

A source is the origin of a transaction. If the transaction was initiated by an HTTP API, for example, you might want record the headers and connection information of the request.
A source is the origin of a transaction. If the transaction was initiated by an HTTP API, for example, you might want
record the headers and connection information of the request.

### Commands

A command represents the intent to perform some operation on the state. Going back to the bank account example, one command could be `PerformDeposit` while another could be `PerformWithdrawl`. The things that you can do are commands.
A command represents the intent to perform some operation on the state. Going back to the bank account example, one
command could be `PerformDeposit` while another could be `PerformWithdrawl`. The things that you can do are commands.

### Facts

A fact is the result of executing a command on the state. In our bank account example, the fact produced by `PerformDeposit` would be `DepositPerformed`; for `PerformWithdrawl` it would be `WithdrawlPerformed`. However, commands and facts **DO NOT** need to be one-to-one. A single command can yield as many facts as are needed. You should keep your facts _bite sized_/_small_.
A fact is the result of executing a command on the state. In our bank account example, the fact produced
by `PerformDeposit` would be `DepositPerformed`; for `PerformWithdrawl` it would be `WithdrawlPerformed`. However,
commands and facts **DO NOT** need to be one-to-one. A single command can yield as many facts as are needed. You should
keep your facts _bite sized_/_small_.

### Tying it all together

The source, commands, and facts, are all tied together under one transient object - the transaction. A transaction can have exactly one source and can have many commands; each command can have many facts. When you need to commit your changes, you commit the transaction - it's all or nothing.
The source, commands, and facts, are all tied together under one transient object - the transaction. A transaction can
have exactly one source and can have many commands; each command can have many facts. When you need to commit your
changes, you commit the transaction - it's all or nothing.
2 changes: 1 addition & 1 deletion src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ csharp_style_conditional_delegate_call = true:suggestion

# Modifier preferences
csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:silent

# Code-block preferences
csharp_prefer_braces = true:silent
Expand Down
30 changes: 15 additions & 15 deletions src/EntityDb.Abstractions/Agents/IAgent.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
namespace EntityDb.Abstractions.Agents
{
/// <summary>
/// Represents an entity who can interact with transactions.
/// </summary>
public interface IAgent
{
/// <summary>
/// Returns wether or not the agent has a particular role.
/// </summary>
/// <param name="role">The role.</param>
/// <returns>Wether or not the agent has a particular role.</returns>
bool HasRole(string role);
}
}
namespace EntityDb.Abstractions.Agents
{
/// <summary>
/// Represents an entity who can interact with transactions.
/// </summary>
public interface IAgent
{
/// <summary>
/// Returns wether or not the agent has a particular role.
/// </summary>
/// <param name="role">The role.</param>
/// <returns>Wether or not the agent has a particular role.</returns>
bool HasRole(string role);
}
}
Loading

0 comments on commit 3546641

Please sign in to comment.