Skip to content

Commit 32b71cd

Browse files
committed
1. Hotfix for old versions
2. Update doc a little bit
1 parent 24ce6a2 commit 32b71cd

2 files changed

Lines changed: 13 additions & 16 deletions

File tree

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/wissance/WebApiToolkit?style=plastic)
44
![GitHub issues](https://img.shields.io/github/issues/wissance/WebApiToolkit?style=plastic)
55
![GitHub Release Date](https://img.shields.io/github/release-date/wissance/WebApiToolkit)
6-
![GitHub release (latest by date)](https://img.shields.io/github/downloads/wissance/WebApiToolkit/v2.0.0/total?style=plastic)
6+
![GitHub release (latest by date)](https://img.shields.io/github/downloads/wissance/WebApiToolkit/v4.0.1/total?style=plastic)
77

88
## 10 Lines of code = Full CRUD and even BULK with swagger docs
99

@@ -41,6 +41,9 @@ For the easiest way you only need:
4141
- `Wissance.WeatherControl.WebApi` uses `EntityFramework`;
4242
- `Wissance.WeatherControl.WebApi.V2` uses `EdgeDb`
4343
* support writing `GRPC` services with examples (see `Wissance.WebApiToolkit.TestApp` and `Wissance.WebApiToolkit.Tests`)
44+
* Manager classes that support file operation over:
45+
- web folders (folders from mounted devices or just local folders)
46+
- `S3 AWS-compatible` (tested with `Yandex Object Storage` and previously with `Cloudflare R2` and `Amazon S3`)
4447

4548
Key concepts:
4649
1. `Controller` is a class that handles `HTTP-requests` to `REST Resource`.
@@ -254,7 +257,11 @@ public class CodeGrpcService : CodeService.CodeServiceBase
254257
Unfortunately GRPC generates all types Request and therefore we should implement additional mapping to convert `DTO` to Response, see full example in this solution in the `Wissance.WebApiToolkit.TestApp` project
255258

256259
### 5. Nuget package
257-
* [Actual for version <= `3.x.y`, obsolete since `4.0.0`](https://www.nuget.org/packages/Wissance.WebApiToolkit)
260+
* [Obsolete version (no bug fixes, no support) <= `3.x.y`, obsolete since `4.0.0`](https://www.nuget.org/packages/Wissance.WebApiToolkit)
261+
* [Core interfaces package](https://www.nuget.org/packages/Wissance.WebApiToolkit.Core)
262+
* [Ef-related implementation of Core](https://www.nuget.org/packages/Wissance.WebApiToolkit.Ef)
263+
* [Cloud AWS S3 Compatible](https://www.nuget.org/packages/Wissance.WebApiToolkit.AWS.S3)
264+
258265

259266
### 6. Examples
260267
Here we consider only Full CRUD controllers because **Full CRUD = Read Only + Additional Operations (CREATE, UPDATE, DELETE)**, a **full example = full application** created with **Wissance.WebApiToolkit** could be found [here]( https://github.com/Wissance/WeatherControl)

Wissance.WebApiToolkit/Wissance.WebApiToolkit.Ef/Managers/EfSoftRemovableModelManager.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public EfSoftRemovableModelManager(DbContext dbContext, Func<TObj, IDictionary<s
5656
/// <param name="sortFunc">>Function that describes how to sort data prior to get a portion</param>
5757
/// <param name="createFunc">Function that describes how to construct DTO from Model, if null passes here then uses _defaultCreateFunc</param>
5858
/// <returns>OperationResult with data portion</returns>
59-
public virtual async Task<OperationResultDto<Tuple<IList<TRes>, long>>> GetManyAsync<TF>(int page, int size, IDictionary<string, string> parameters, SortOption sorting,
59+
public override async Task<OperationResultDto<Tuple<IList<TRes>, long>>> GetManyAsync<TF>(int page, int size, IDictionary<string, string> parameters, SortOption sorting,
6060
Func<TObj, IDictionary<string, string>, bool> filterFunc = null,
6161
Func<TObj, TF> sortFunc = null, Func<TObj, TRes> createFunc = null)
6262
{
@@ -125,7 +125,7 @@ public virtual async Task<OperationResultDto<Tuple<IList<TRes>, long>>> GetManyA
125125
/// <param name="id">item identifier</param>
126126
/// <param name="createFunc">Function that describes how to construct DTO from Model, if null passes here then uses _defaultCreateFunc</param>
127127
/// <returns></returns>
128-
public virtual async Task<OperationResultDto<TRes>> GetOneAsync(TId id, Func<TObj, TRes> createFunc = null)
128+
public override async Task<OperationResultDto<TRes>> GetOneAsync(TId id, Func<TObj, TRes> createFunc = null)
129129
{
130130
try
131131
{
@@ -154,7 +154,7 @@ public virtual async Task<OperationResultDto<TRes>> GetOneAsync(TId id, Func<TOb
154154
/// <param name="sorting">sorting params (Sort - Field name, Order - Sort direction (ASC, DESC))</param>
155155
/// <param name="parameters">raw query parameters</param>
156156
/// <returns>OperationResult with data portion</returns>
157-
public virtual async Task<OperationResultDto<Tuple<IList<TRes>, long>>> GetAsync(int page, int size, SortOption sorting = null,
157+
public override async Task<OperationResultDto<Tuple<IList<TRes>, long>>> GetAsync(int page, int size, SortOption sorting = null,
158158
IDictionary<string, string> parameters = null)
159159
{
160160
// this method is using default sorting and order, if specific order or sorting is required please specify it using another GetAsync method
@@ -171,17 +171,7 @@ public virtual async Task<OperationResultDto<Tuple<IList<TRes>, long>>> GetAsync
171171

172172
return await GetManyAsync(page, size, parameters, sorting, _filterFunc, sortingFunc);
173173
}
174-
175-
/// <summary>
176-
/// GetByIdAsync returns one item by id, IModelManager default implementation
177-
/// </summary>
178-
/// <param name="id">item identifier</param>
179-
/// <returns>OperationResult with one item</returns>
180-
public async Task<OperationResultDto<TRes>> GetByIdAsync(TId id)
181-
{
182-
return await GetOneAsync(id);
183-
}
184-
174+
185175
/// <summary>
186176
/// DeleteAsync method for remove object from Database using Ef
187177
/// </summary>

0 commit comments

Comments
 (0)