Skip to content
Dennis C. Mitchell edited this page Sep 12, 2019 · 7 revisions

The EDennis.AspNetCore.Base library was designed to make it easier to build and test multi-tier applications in ASP.NET Core. A simple example of a multi-tier application is one that has a web application that communicates with one or more web APIs, which in turn use Entity Framework to communicate with one or more databases. Quite possibly, both the web application and web APIs use an IdentityServer for security. For this kind of situation, the off-the-shelf ASP.NET Core requires quite a bit of plumbing work (copy-paste-and-tweak code in Startup, unit test fixtures ... etc.) to develop the solution and create automated integration tests. Also, there is some extra plumbing work if you want to use Swagger for spot testing while IdentityServer is managing the security. The EDennis.AspNetCore.Base library doesn't eliminate this plumbing work, but it can reduce it significantly.

As indicated in the README, the EDennis.AspNetCore.Base library uses the repository pattern and typed client pattern to provide abstractions over Entity Framework and HttpClient communications. These abstractions represent a parallel architecture, of sorts. For more information on the parallel architecture, the base repository classes, and the base API client class, see the Parallel Architecture Page page.

The EDennis.AspNetCore.Base library provides several base classes to make development of ASP.NET Core applications involving Web APIs easier.

  • The library provides base writeable and readonly repository and API controller classes. All base repository and controller classes support Dynamic Linq operations. All API controller classes provide Swagger-friendly support for querying via OData and DevExtreme DataSourceLoadOptions. The writeable repository and controller classes also provide support for basic CRUD operations, while saving a user name/id to the database. The readonly repository and controller classes also provide support for calling parameterized stored procedures and raw SQL.
  • The library provides base Xunit classes for testing repositories and API controllers in various ways. The base Xunit classes use regular configuration files (e.g., appsettings.Development.json) to spin up servers and in-memory databases where needed, even for Web APIs that call other Web APIs in different applications (in the same solution).

One of the more interesting features of the EDennis.AspNetCore.Base library is its support for Temporal Entities. Temporal Entities is an Entity-Framework-oriented analog to SQL Server Temporal Tables. In a nutshell, Temporal Entities allow the developer to keep an audit trail of update and delete operations and to perform time-travel (as-of) queries on data -- all through Entity Framework. Temporal Entities have some advantages over SQL Server Temporal Tables, including the ability to configure rules for when update and delete operations result in a history record. For more information on Temporal Entities, see the Temporal Entities Page page.

Clone this wiki locally