Skip to content
EpicBrownie edited this page May 6, 2019 · 13 revisions

Crud is a library that complements the Turner Mediator by providing default, configurable request handlers for commonly-used (CRUD) requests.

Dependencies

Crud has the following dependencies:

The following supplemental packages are also available:

Library Configuration

Quick Start

  1. Install the Turner.Infrastructure.Crud.All nuget package
  2. Create a Crud initializer with the project's SimpleInjector container and any assemblies containing Crud requests, validators, or other Crud artifacts. At very least, an interface to the data context must be configured.
Crud.CreateInitializer(container, assemblies)
    .UseCommonInitialization()
    .Initialize();

UseCommonInitializer() will configure an interface to an Entity Framework Core data context.

Supplemental Packages

Turner.Infrastructure.Crud.EntityFrameworkCore

Adds the UseEntityFramework() configuration method to Crud initializers.

This method will configure an interface to an Entity Framework Core data context.

Turner.Infrastructure.Crud.FluentValidation

Adds the UseFluentValidation() configuration method to Crud initializers.

This method will attach a default validator (IRequestValidator) implementation to all Crud request handlers which will attempt to run a FluentValidation IValidator on request objects.
These validators will respect the Crud initialization's ValidateAllRequests() setting.
See the validation page for more information on request validation.

Turner.Infrastructure.Crud.All

Adds the UseCommonInitialization() configuration method to Crud initializers.
This method is equivalent to calling UseEntityFramework() and UseFluentValidation() from the above packages.