Skip to content

Commit

Permalink
Doco updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
chullybun committed Oct 3, 2024
1 parent 91e8ded commit 6fb434f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
11 changes: 8 additions & 3 deletions src/CoreEx.Cosmos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The motivation is to provide supporting Cosmos DB capabilities for [CRUD](https:

The requirements for usage are as follows.
- An **entity** (DTO) that represents the data that must as a minimum implement [`IEntityKey`](../CoreEx/Entities/IEntityKey.cs); generally via either the implementation of [`IIdentifier`](../CoreEx/Entities/IIdentifierT.cs) or [`IPrimaryKey`](../CoreEx/Entities/IPrimaryKey.cs).
- A **model** being the underlying data representation that will be persisted within CosmosDB itself..
- A **model** being the underlying data representation that will be persisted within Cosmos DB itself.
- An [`IMapper`](../CoreEx/Mapping/IMapper.cs) that contains the mapping logic to map to and from the **entity** and **model**.

The **entity** and **model** are different types to encourage separation between the externalized **entity** representation and the underlying **model**; which may be shaped differently, and have different property naming conventions, internalized properties, etc.
Expand Down Expand Up @@ -70,14 +70,18 @@ From a Cosmos DB perspective, a [Container](https://learn.microsoft.com/en-us/az
A Cosmos DB Container is encapsulated within one of the following _CoreEx_ capabilities depending on the patterns required:

Type | Container Pattern | Document Pattern | [`IMapper`](../CoreEx/Mapping/IMapper.cs) support
-|-|-
-|-|-|-
[`CosmosDbContainer`](CosmosDbContainer.cs) | Entity | Untyped | Yes
[`CosmosDbValueContainer`](CosmosDbValueContainer.cs) | Entity | Typed | No
[`CosmosDbModelContainer`](Model/CosmosDbModelContainer.cs) | Model | Untyped | Yes
[`CosmosDbValueModelContainer`](Model/CosmosDbValueModelContainer.cs) | Model | Typed | No

Where more advanced CosmosDB capabilities are required, for example, Partitioning, etc., then the [`CosmosDbArgs`](./CosmosDbArgs.cs) enables the configuration of these capabilities, as well as other extended _CoreEx_ capabilities such as multi-tenancy support.

Additionally, given how important Partitioning is to Cosmos DB performance, many methods have been provided with an optional `partitionKey` parameter to enable the developer to specify the partition key for the operation.

Finally, where a Container contains multiple typed documents, an advanced query capability is provided to select and return one-or-more types in a single performant operation; see [`CosmosDb.SelectMultiSetWithResultAsync`](./CosmosDb.cs). The [`SelectMultiSetAsync`](../../tests/CoreEx.Cosmos.Test/CosmosDbContainerPartitioningTest.cs) unit test provides example usage.

<br/>

## Database
Expand Down Expand Up @@ -142,7 +146,7 @@ The **entity** [`ICosmosDbContainer<T, TModel>`](./ICosmosDbContainerT.cs) and *

### Query (Read)

A query is actioned using the [`CosmosDbQuery<T, TModel>`](./CosmosDbQuery.cs) and [`CosmosDbModelQuery<TModel>`](./Model/CosmosDbModelQuery.cs) which is obstensibly a lightweight wrapper over an `IQueryable<TModel>` that automatically maps from the **model** to the **entity** (where applicable).
A query is actioned using the [`CosmosDbQuery<T, TModel>`](./CosmosDbQuery.cs) and [`CosmosDbModelQuery<TModel>`](./Model/CosmosDbModelQuery.cs) which is ostensibly a lightweight wrapper over an `IQueryable<TModel>` that automatically maps from the **model** to the **entity** (where applicable).

Uses the [`Container.GetItemLinqQueryable`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.container.getitemlinqqueryable?view=azure-dotnet) internally to create.

Expand Down Expand Up @@ -207,6 +211,7 @@ Where the **model** implements [`ILogicallyDeleted`](../CoreEx/Entities/ILogical

Otherwise, will physically delete. Uses the [`Container.DeleteItemAsync`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.container.deleteitemasync?view=azure-dotnet) internally to delete.

<br/>

## Usage

Expand Down
1 change: 0 additions & 1 deletion src/CoreEx.Database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ To simplify the support for the [retrieval of multiple result sets](https://lear

The following `IMultiSetArgs` implementations are provided. The `StopOnNull` property indicates whether to stop further query result set processing where the current set has resulted in a `null` (i.e. no records).


Class | Description
-|-
[`MultiSetCollArgs<TColl, TItem>`](./MultiSetCollArgsT.cs) | Provides the multi-set arguments when expecting a collection of items/records. The `MinRows` and `MaxRows` properties can also be specified to ensure/validate correctness of returned rows.
Expand Down
2 changes: 1 addition & 1 deletion src/CoreEx.EntityFrameworkCore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The [`IEfDb`](./IEfDb.cs) and corresponding [`EfDb`](./EfDb.cs) provides the bas

### Query (read)

A query is actioned using the [`EfDbQuery`](./EfDbQuery.cs) which is obstensibly a lightweight wrapper over an `IQueryable<TModel>` that automatically maps from the **model** to the **entity**.
A query is actioned using the [`EfDbQuery`](./EfDbQuery.cs) which is ostensibly a lightweight wrapper over an `IQueryable<TModel>` that automatically maps from the **model** to the **entity**.

Queried entities are not tracked by default; internally uses [`AsNoTracking`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.entityframeworkqueryableextensions.asnotracking); this behaviour can be overridden using [`EfDbArgs.QueryNoTracking`](./EfDbArgs.cs).

Expand Down
2 changes: 1 addition & 1 deletion src/CoreEx.OData/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The [`IOData`](./IOData.cs) and corresponding [`ODataClient`](./ODataClient.cs)

### Query (read)

A query is actioned using the [`ODataQuery`](./ODataQuery.cs) which is obstensibly a lighweight wrapper over an `IBoundClient<TModel>`(https://github.com/simple-odata-client/Simple.OData.Client/blob/master/src/Simple.OData.Client.Core/Fluent/IBoundClient.cs) that automatically maps from the **model** to the **entity**.
A query is actioned using the [`ODataQuery`](./ODataQuery.cs) which is ostensibly a lighweight wrapper over an `IBoundClient<TModel>`(https://github.com/simple-odata-client/Simple.OData.Client/blob/master/src/Simple.OData.Client.Core/Fluent/IBoundClient.cs) that automatically maps from the **model** to the **entity**.

The following methods provide additional capabilities:

Expand Down
2 changes: 1 addition & 1 deletion src/CoreEx/Events/Subscribing/EventSubscriberArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace CoreEx.Events.Subscribing
{
/// <summary>
/// Provides the <see cref="EventSubscriberBase"/> arguments; is obstensibly a <see cref="Dictionary{TKey, TValue}"/> with a <see cref="string"/> key and <see cref="object"/> value.
/// Provides the <see cref="EventSubscriberBase"/> arguments; is ostensibly a <see cref="Dictionary{TKey, TValue}"/> with a <see cref="string"/> key and <see cref="object"/> value.
/// </summary>
/// <remarks>This enables runtime state to passed through to the underlying subscriber receive logic where applicable.</remarks>
public class EventSubscriberArgs : Dictionary<string, object?>
Expand Down

0 comments on commit 6fb434f

Please sign in to comment.