TheOmenDen.Shared.Interfaces
1.8.27.428
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package TheOmenDen.Shared.Interfaces --version 1.8.27.428
NuGet\Install-Package TheOmenDen.Shared.Interfaces -Version 1.8.27.428
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TheOmenDen.Shared.Interfaces" Version="1.8.27.428" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TheOmenDen.Shared.Interfaces --version 1.8.27.428
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TheOmenDen.Shared.Interfaces, 1.8.27.428"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TheOmenDen.Shared.Interfaces as a Cake Addin #addin nuget:?package=TheOmenDen.Shared.Interfaces&version=1.8.27.428 // Install TheOmenDen.Shared.Interfaces as a Cake Tool #tool nuget:?package=TheOmenDen.Shared.Interfaces&version=1.8.27.428
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
TheOmenDen Shared Interfaces
A collection of interfaces present in The Omen Den's applications
Below are descriptions to the best of my ability for what each section in the namespaces defines.
1. Accessors
IAccessor
- Allows for simple access to read only methods defined across an entity.
- Works for Database entities, and other areas where you need to limit to read only methods.
IAsyncStreamAccessor
- ALlows for asynchronous streaming access to read only methods defined across an entity.
- Allows for
await foreach
by way of returning anIAsyncEnumerable
.
IKeyedAccessor
- Allows for a bit more complicated access to read only methods defined across an entity.
- Working with
IEntityKey
as the prevealent key to allow for searching across conditions. - Methods defined here return a
Tuple
combination of the Result and the corresponding entities retrieved.- The result specified is a boolean indicating whether the underlying operation was successful
True
on success, otherwiseFalse
. - This is to hopefully guide the implementation away from throwing an exception when the operation is unsuccessful.
- The result specified is a boolean indicating whether the underlying operation was successful
IKeyedAsyncStreamAccessor
- Similar to the
IKeyedAccessor
but returns only theIAsyncEnumerable
stream - Allows for streaming access to read only methods defined across an keyed entities, and returns matches for the provided key.
- Similar to the
2. Repositories
IRepository
- A covariant interface that requires the implementation to also implement
IEnumerable
. - Defines methods for Adding/Creating, Updating, and Deleting entties with
CancellationToken
support on asynchronous methods. - This will allow for accessing the underlying methods of the repository with
System.Linq
as well asforeach
loops.
- A covariant interface that requires the implementation to also implement
IStreamingRepository
- A covariant interface that requires the implementation to also implement
IAsyncEnumerable
. - Defines methods for Adding/Creating, Updating, and Deleting entties with
CancellationToken
support on asynchronous methods. - This will allow for asynchronous streaming access of the underlying methods via
System.Linq.Async
as well asawait foreach
loops.
- A covariant interface that requires the implementation to also implement
IDataOperations
- A combination interface that contains the methods defined in both
IRepository
andIStreamingRepository
. - Defines methods for Adding/Creating, Updating, and Deleting entties with
CancellationToken
support on asynchronous methods. - This allows for a flexible approach to methods within the implementation to incorporate traditional methods, as well as asynchronous streaming.
- A combination interface that contains the methods defined in both
IKeyedDataOperations
- A combination interface that contains the methods defined in both
IRepository
andIStreamingRepository
.- To better distinguish between
IDataOperations
andIKeyedDataOperations
.- There's the additional constrained generic parameter
TKey
which requires that the key be provided during construction of an implementation, as well as be of typeIEntityKey
. - This is intentional since we should be approaching these methods with relative caution, and capture the intent, and rational for object manipulation.
- There's the additional constrained generic parameter
- To better distinguish between
- Defines methods for Adding/Creating, Updating, and Deleting entties with
CancellationToken
support on asynchronous methods. - A mjaor difference between this interface and
IDataOperations
is that the results of each method to implement requires a return value. ofTuple{TResult, TEntity}
TResult
is typically a boolean, but could signify any sort of indicator of the success or failure of the operation.- This was done to hopefully discourage exception throwing in the implementations and define a "peaceful" approach to handling failures.
- This approach does present a tighter coupling between the results of the operation and the Entity(or entities) returned.
- A combination interface that contains the methods defined in both
3. Models
IUser
- A simple interface to mark the definition of a
user
.Id
- a GUID/UUID that allows for easy storage and retrieval of user information.Email
- an individual's email address.Name
- the name of the user.IsAuthenticated
- indicates whether the user is authenticated.Key
- the key associated with the user (integer based).
- A simple interface to mark the definition of a
ITenant
- A representation of the container for organization/business items, logic, and information.
Id
- a GUID/UUID that allows for easy storage and retrieval of tenant information.Code
- The code associated with the tenant.Name
- the name of the tenant.Key
- the key associated with the tenant (integer based).
- A representation of the container for organization/business items, logic, and information.
IEntityKey
- Provides a generic interpretation to help distinguish entities from each other.
Id
- a GUID/UUID that allows for easy storage and retrieval.CreatedAt
- a timestamp marking the entity's creation.ITenant
- The Tenant that entity is associated with.IUser
- the originator/creator of the entity.
- Provides a generic interpretation to help distinguish entities from each other.
IEntity
- A simple marker interface that provides an implementation with a way to define a unique
IEntityKey
on an Entity.IEntityKey
the unique key associated with the entity.
- A simple marker interface that provides an implementation with a way to define a unique
4. Services
IApiService
andIApiService<T>
IApiService
is an empty interface.- This was done for ease of implementation when it came to dependency injection in implementations with
Scrutor
.
- This was done for ease of implementation when it came to dependency injection in implementations with
IApiService<T>
contains CRUD methods that can be used to retrieve and alter information via an external API.- CRUD methods are defined to
GET
,POST
,PUT
,DELETE
and all provideCancellationToken
support.
- CRUD methods are defined to
IStreamingApiService
andIStreamingApiService<T>
IStreamingApiService
is an empty interface.- This was done for ease of implementation when it came to dependency injection in implementations with
Scrutor
.
- This was done for ease of implementation when it came to dependency injection in implementations with
IstreamingApiService<T>
- Defines two different methods of retrieving results from an external API. These methods do allow forCancellationToken
support.StreamApiResultsAsync
- Returns anIASyncEnumerable<ApiResponse>
.ApiResponse
- from TheOmenDen.Shared project.- This was done to allow for failure of individual objects contained in the response body, while still allowing for streaming of the results.
- Enumerate with
await foreach
EnumerateApiResultsAsync
- Returns aTask<ApiResponse<IEnumerable<T>>>
- This will retrieve the results from the api whiel the header content is read, and before the entire result set is read.
- This was done to provide an easy implementation and encourage the use of the
System.Text.Json JsonSerializer
's ability to read through streams.
ToDos
- Define more constructive interfaces
- Refine the use cases of currently defined interfaces
- Improve the functionality and performance of interfaces
- Provide ways for source generators to be used
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- TheOmenDen.Shared (>= 2022.8.27.345)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TheOmenDen.Shared.Interfaces:
Package | Downloads |
---|---|
TheOmenDen.Shared.Services
A collection of the service implementations used throughout the various apps that The Omen Den develops. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.12.1.48 | 201 | 12/1/2023 |
2.3.20.1734 | 1,632 | 3/20/2023 |
1.11.13.2216 | 473 | 11/14/2022 |
1.10.8.106 | 2,255 | 10/8/2022 |
1.8.27.428 | 891 | 8/27/2022 |
1.7.26.1301 | 734 | 7/26/2022 |
Provides the basis for interfaces for various purposes