decaf-orm.services
0.1.339
dotnet add package decaf-orm.services --version 0.1.339
NuGet\Install-Package decaf-orm.services -Version 0.1.339
<PackageReference Include="decaf-orm.services" Version="0.1.339" />
<PackageVersion Include="decaf-orm.services" Version="0.1.339" />
<PackageReference Include="decaf-orm.services" />
paket add decaf-orm.services --version 0.1.339
#r "nuget: decaf-orm.services, 0.1.339"
#:package decaf-orm.services@0.1.339
#addin nuget:?package=decaf-orm.services&version=0.1.339
#tool nuget:?package=decaf-orm.services&version=0.1.339
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 typeTKeyIEntity<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>
Alternatively, if you are using the IUnitOfWork patter, you may use the following extension methods:
uow.GetQuery<Person>();
uow.GetCommand<Person>();
uow.GetService<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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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.327)
- Microsoft.Extensions.DependencyInjection (>= 9.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.