decaf-orm.services 0.1.236

This package has a SemVer 2.0.0 package version: 0.1.236+165aefec366568dbc90f1fb35aa9486373aa557e.
There is a newer version of this package available.
See the version list below for details.
dotnet add package decaf-orm.services --version 0.1.236                
NuGet\Install-Package decaf-orm.services -Version 0.1.236                
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="decaf-orm.services" Version="0.1.236" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add decaf-orm.services --version 0.1.236                
#r "nuget: decaf-orm.services, 0.1.236"                
#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 decaf-orm.services as a Cake Addin
#addin nuget:?package=decaf-orm.services&version=0.1.236

// Install decaf-orm.services as a Cake Tool
#tool nuget:?package=decaf-orm.services&version=0.1.236                

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:

  1. IEntity - no primary key defined
  2. IEntity<TKey> - a single primary key of the type TKey
  3. IEntity<TKeyOne, TKeyTwo> - a composite primay key of the type <TKeyOne, TKeyTwo>
  4. 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:

Build
Build CodeQL
Sonar Cloud
Quality Gate Status Maintainability Rating Code Smells Coverage Technical Debt
Reliability Rating Duplicated Lines (%) Vulnerabilities Bugs Security Rating

Documentation

Documentation can be found here: README.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.1.265 29 7/10/2024
0.1.264 44 7/7/2024
0.1.257 43 6/9/2024
0.1.236 60 4/2/2024
0.1.210 63 3/15/2024