Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.

Commit f324f7e

Browse files
author
Morten Turn Pedersen
authored
Merge pull request #66 from monstarlab-dotnet/feature/55-update-readme
Updated readme
2 parents 12e25f3 + 713b93e commit f324f7e

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
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.
44

5-
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.
5+
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.
66

77
## Entities
88

9-
### BaseEntity
9+
### EntityBase
1010
The base entity contains the following properties:
1111

1212
| Name | Type | Description |
1313
| ---- | ---- | ----------- |
14-
| Id | Guid? | The unique id of the entity |
14+
| Id | TId | The unique id of the entity |
1515
| Created | DateTime | The UTC time for when this entity was created |
1616
| Updated | DateTime | The UTC time for when this entity was last updated |
1717

1818
### BaseSoftDeleteEntities
19-
This class extends `BaseEntity` and adds the following properties:
19+
This class extends `EntityBase` and adds the following properties:
2020

2121
| Name | Type | Description |
2222
| ---- | ---- | ----------- |
@@ -30,21 +30,21 @@ This is the entity service which handles the communication with the database. Th
3030

3131
| Function | Description |
3232
| -------- | ----------- |
33-
| Get | Fetch a single entity |
34-
| GetList | Get a filtered and possibly paginated list of entities |
35-
| GetListWithSelect | Get a filtered and possibly paginated list of entities where you can specify what properties to return |
36-
| Add | Add a new entity to the DB. The function automatically sets `Created`, `Updated`, and `Id` on the entity |
37-
| Update | Update the provided entity in the DB. The function automatically sets `Updated` |
38-
| Delete | Removes the entity from the DB |
33+
| GetAsync | Fetch a single entity |
34+
| GetListAsync | Get a filtered and possibly paginated list of entities |
35+
| GetListWithSelectAsync | Get a filtered and possibly paginated list of entities where you can specify what properties to return |
36+
| AddAsync | Add a new entity to the DB. The function automatically sets `Created`, `Updated`, and `Id` on the entity |
37+
| UpdateAsync | Update the provided entity in the DB. The function automatically sets `Updated` |
38+
| DeleteAsync | Removes the entity from the DB |
3939

4040
### EntitySoftDeleteRepository
4141
This entity repository handles soft delete entities. It implements the interface `IEntitySoftDeleteRepository` for DI purposes.
4242

43-
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).
43+
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).
4444

45-
Along with the methods from `EntityRepository`, this repository implements the following extra methods along with changed behaviour on `Delete`:
45+
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:
4646

4747
| Function | Description |
4848
| -------- | ----------- |
49-
| Delete | Soft delete the entity. Sets `Deleted` to `true` and sets `Deleted` as well |
50-
| Restore | Undelete the entity. Sets `Deleted` to `false` and sets `DeletedAt` to `null` |
49+
| DeleteAsync | Soft delete the entity. Sets `Deleted` to `true` and sets `Deleted` as well |
50+
| RestoreAsync | Undelete the entity. Sets `Deleted` to `false` and sets `DeletedAt` to `null` |

0 commit comments

Comments
 (0)