EntityDb.Mvc
6.3.0
See the version list below for details.
dotnet add package EntityDb.Mvc --version 6.3.0
NuGet\Install-Package EntityDb.Mvc -Version 6.3.0
<PackageReference Include="EntityDb.Mvc" Version="6.3.0" />
paket add EntityDb.Mvc --version 6.3.0
#r "nuget: EntityDb.Mvc, 6.3.0"
// Install EntityDb.Mvc as a Cake Addin #addin nuget:?package=EntityDb.Mvc&version=6.3.0 // Install EntityDb.Mvc as a Cake Tool #tool nuget:?package=EntityDb.Mvc&version=6.3.0
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.
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?
- Option A - Table Rows
- 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
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?
There are five core objects at the heart of this implementation
- Transactions
- Agent
- Commands
- Tags
- Leases
Transactions
A transaction represents an atomic operation on multiple entities. A transaction is ideally* committed atomically or not at all. If some step in the transaction fails, the entire transaction should fail.
*In the MongoDb implementation, the transaction is committed atomically. However, it is possible in the future that there will be implementations that are not capable of doing this if you want to use tags and/or leases. An example would be EventStore, which provides no ability to enforce uniqueness constraints in its transaction. Such implementations will need a complimentary transaction in order to make use of tags and leases.
Agent
An agent is an actor that can execute transactions. For example, if a transaction is initiated via an HTTP API, you might use
the HttpContextAgent
- it's signature includes headers and connection information, and it uses the ClaimsPrincipal to decide
if an agent has a particular role required for authorized commands.
Commands
A command represents the intent to perform some operation on a single entity. 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.
Tags
A tag is a way to index entities by some piece of information. A tag can have a label and a value, both of which are strings.
Many accounts are typed, and you could represent this with a tag where Label
is Type
and Value
is Savings
or Checking
.
You could then run a query to get the account id of all accounts where Label
is Type
and Value
is Savings
. The number
of savings accounts in the system would be the number of entity ids.
Leases
A lease is like a tag, except that it has a uniqueness constraint. Many banks have online portals, allowing bank members
to see their accounts on the internet. From the bank's perspective, all of the accounts should be tied to a member id,
probably a guid. But the member will not want to remember nor lookup this guid - they will want to use a username.
What you can do in EntityDb is make a lease for member entities where the entity id is the member id, the Label
is Username
and the Value
is whatever username the member wants to use. If an attempt to commit a transaction is made that would violate the
uniqueness constraint, it will be rejected. (This is obnoxious behavior for the user, though, so the bank should check before attempting
to commit to see if the username is available and give immediate feedback to choose a different username).
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- EntityDb.Common (>= 6.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
9.2.0 | 161 | 8/30/2023 |
9.1.0 | 156 | 8/30/2023 |
9.0.0 | 336 | 11/20/2022 |
8.2.0 | 79 | 10/21/2024 |
8.1.1 | 442 | 9/5/2023 |
8.0.4 | 320 | 11/24/2022 |
8.0.3 | 513 | 9/8/2022 |
8.0.2 | 426 | 8/8/2022 |
8.0.1 | 407 | 8/7/2022 |
8.0.0 | 395 | 8/7/2022 |
7.1.1 | 401 | 9/7/2022 |
7.1.0 | 420 | 7/10/2022 |
7.0.0 | 442 | 7/4/2022 |
6.7.0 | 456 | 6/24/2022 |
6.6.0 | 409 | 6/24/2022 |
6.5.0 | 445 | 5/19/2022 |
6.5.0-build2 | 151 | 5/24/2022 |
6.4.0 | 409 | 5/19/2022 |
6.3.0 | 409 | 5/18/2022 |
6.2.0 | 521 | 4/6/2022 |
6.1.0 | 458 | 4/6/2022 |
6.0.2 | 431 | 4/6/2022 |
6.0.1 | 435 | 4/6/2022 |
6.0.0 | 424 | 3/30/2022 |
5.0.0 | 500 | 2/27/2022 |
4.0.1 | 323 | 12/29/2021 |
4.0.0 | 274 | 12/29/2021 |
3.6.0 | 304 | 12/20/2021 |
3.5.0 | 263 | 12/19/2021 |
3.4.0 | 289 | 12/18/2021 |
3.3.0 | 291 | 12/18/2021 |
3.2.0 | 330 | 10/8/2021 |
3.1.0 | 321 | 10/7/2021 |
3.0.0 | 359 | 10/7/2021 |
2.3.0 | 309 | 10/6/2021 |
2.2.0 | 378 | 10/1/2021 |
2.1.3 | 388 | 9/27/2021 |
2.1.2 | 335 | 9/26/2021 |
2.1.1 | 331 | 9/26/2021 |
2.1.0 | 355 | 9/26/2021 |
2.0.3 | 325 | 9/17/2021 |
2.0.2 | 373 | 9/12/2021 |
2.0.0 | 381 | 7/22/2021 |
1.0.9 | 337 | 6/19/2021 |
1.0.8 | 326 | 6/17/2021 |
1.0.7 | 355 | 6/15/2021 |
1.0.6 | 356 | 6/15/2021 |
1.0.5 | 340 | 6/8/2021 |
1.0.4 | 381 | 5/28/2021 |
1.0.3 | 338 | 5/27/2021 |
1.0.2 | 154 | 5/27/2021 |
1.0.1 | 308 | 5/26/2021 |
1.0.0 | 397 | 5/24/2021 |