From 713b93e28904dc29e26d12dad8c9cb7680324c35 Mon Sep 17 00:00:00 2001 From: Morten Turn Pedersen Date: Fri, 19 Nov 2021 12:35:55 +0100 Subject: [PATCH] Updated readme --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8f77799..533a2ef 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,21 @@ This NuGet package contains a base entity definition along with an entity service which handles the update, delete, add etc. which automatically sets the properties on the base entity and does some basic validation. Every class is extendable, so you can fit it to your needs. The `Add`, `Delete`, `Update`, and `Restore` functions on the entity services are all `virtual`, so you can extend them to fit your needs if you e.g. need more base attributes set automatically. -The class `BaseEntity` is for hard delete entities while `BaseSoftDeleteEntity` is for entities which are only soft deleted. There are repositories for each type of entity as well with mostly the same functionality although the soft delete version has a few extra parameters and also has a restore function. +The class `EntityBase` is for hard delete entities while `EntitySoftDeleteBase` is for entities which are only soft deleted. There are repositories for each type of entity as well with mostly the same functionality although the soft delete version has a few extra parameters and also has a restore function. ## Entities -### BaseEntity +### EntityBase The base entity contains the following properties: | Name | Type | Description | | ---- | ---- | ----------- | -| Id | Guid? | The unique id of the entity | +| Id | TId | The unique id of the entity | | Created | DateTime | The UTC time for when this entity was created | | Updated | DateTime | The UTC time for when this entity was last updated | ### BaseSoftDeleteEntities -This class extends `BaseEntity` and adds the following properties: +This class extends `EntityBase` and adds the following properties: | Name | Type | Description | | ---- | ---- | ----------- | @@ -30,21 +30,21 @@ This is the entity service which handles the communication with the database. Th | Function | Description | | -------- | ----------- | -| Get | Fetch a single entity | -| GetList | Get a filtered and possibly paginated list of entities | -| GetListWithSelect | Get a filtered and possibly paginated list of entities where you can specify what properties to return | -| Add | Add a new entity to the DB. The function automatically sets `Created`, `Updated`, and `Id` on the entity | -| Update | Update the provided entity in the DB. The function automatically sets `Updated` | -| Delete | Removes the entity from the DB | +| GetAsync | Fetch a single entity | +| GetListAsync | Get a filtered and possibly paginated list of entities | +| GetListWithSelectAsync | Get a filtered and possibly paginated list of entities where you can specify what properties to return | +| AddAsync | Add a new entity to the DB. The function automatically sets `Created`, `Updated`, and `Id` on the entity | +| UpdateAsync | Update the provided entity in the DB. The function automatically sets `Updated` | +| DeleteAsync | Removes the entity from the DB | ### EntitySoftDeleteRepository This entity repository handles soft delete entities. It implements the interface `IEntitySoftDeleteRepository` for DI purposes. -For each method in `EntityRepository` where relevant, there are extra parameters for handling soft delete entities e.g. `GetList` where you can choose whether to include deleted in the result list or not (not by default). +For each method in `EntityRepository` where relevant, there are extra parameters for handling soft delete entities e.g. `GetListAsync` where you can choose whether to include deleted in the result list or not (not by default). -Along with the methods from `EntityRepository`, this repository implements the following extra methods along with changed behaviour on `Delete`: +Along with the methods from `EntityRepository`, this repository implements the following extra methods along with changed behaviour on `DeleteAsync` including extra parameters regarding to soft delete behaviour on the other functions: | Function | Description | | -------- | ----------- | -| Delete | Soft delete the entity. Sets `Deleted` to `true` and sets `Deleted` as well | -| Restore | Undelete the entity. Sets `Deleted` to `false` and sets `DeletedAt` to `null` | \ No newline at end of file +| DeleteAsync | Soft delete the entity. Sets `Deleted` to `true` and sets `Deleted` as well | +| RestoreAsync | Undelete the entity. Sets `Deleted` to `false` and sets `DeletedAt` to `null` | \ No newline at end of file