decaf-orm.services
0.1.210
See the version list below for details.
dotnet add package decaf-orm.services --version 0.1.210
NuGet\Install-Package decaf-orm.services -Version 0.1.210
<PackageReference Include="decaf-orm.services" Version="0.1.210" />
paket add decaf-orm.services --version 0.1.210
#r "nuget: decaf-orm.services, 0.1.210"
// Install decaf-orm.services as a Cake Addin #addin nuget:?package=decaf-orm.services&version=0.1.210 // Install decaf-orm.services as a Cake Tool #tool nuget:?package=decaf-orm.services&version=0.1.210
decaf.services
This package provides additional services or wrappers which may be useful. Primarily it provides services split using the CQRS pattern:
Query<T>
Command<T>
- or combined
Service<T>
There are several variants of these, that allow for multiple composite keys on entities.
This is supplied through the IEntity
interface, which has four variants:
IEntity
- no primary key definedIEntity<TKey>
- a single primary key of the typeTKey
IEntity<TKeyOne, TKeyTwo>
- a composite primay key of the type<TKeyOne, TKeyTwo>
IEntity<TKeyOne, TKeyTwo, TKeyThree>
- a composite primary key of the type<TKeyOne, TKeyTwo, TKeyThree>
Each of these exist for the Command
, Query
and Service
variants.
Each IEntity
has a KeyMetadata
property, which represents the primary key information for that object.
This is either just an IKeyMetadata
instance, or it is a ICompositeKey
corresponding to the primary key as defined.
To use services, your entities should inherit from one of the Entity
classes as they provide the base structures necessary for the services to operate.
You will need to provide the key metadata at this point.
An example of a simple entity is below:
public class Person : Entity<int>
{
public Person() : base(nameof(Id)) { }
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
Note that the key name is passed into the base constructor to provide the key metadata.
To add a Query
, Command
or Service
to your DI container, use the following as a template:
services.AddDecafService<Person>().AsScoped();
You can also use AsSingleton()
or AsTransient()
depending on your requirements.
The above method registers the following:
IQuery<Person>
ICommand<Person>
IService<Person>
Status:
Documentation
Documentation can be found here: README.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- decaf-orm (>= 0.1.208)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.