Flavio.Santos.NetCore.ApiResponse
1.0.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Flavio.Santos.NetCore.ApiResponse --version 1.0.3
NuGet\Install-Package Flavio.Santos.NetCore.ApiResponse -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Flavio.Santos.NetCore.ApiResponse" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Flavio.Santos.NetCore.ApiResponse" Version="1.0.3" />
<PackageReference Include="Flavio.Santos.NetCore.ApiResponse" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Flavio.Santos.NetCore.ApiResponse --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Flavio.Santos.NetCore.ApiResponse, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Flavio.Santos.NetCore.ApiResponse&version=1.0.3
#tool nuget:?package=Flavio.Santos.NetCore.ApiResponse&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FDS.NetCore.ApiResponse
🚀 FDS.UuidV7.NetCore is a lightweight .NET library for generating UUID v7 (time-based UUIDs) according to the official specification.
📦 Installation
You can install this package via NuGet Package Manager:
dotnet add package Flavio.Santos.NetCore.ApiResponse --version 1.0.2
Or using Package Manager Console:
Install-Package Flavio.Santos.NetCore.ApiResponse -Version 1.0.2
🚀 Usage
Creating a Standard API Response
Adding a New Client
public async Task<Response<ClientDto>> AddAsync(ClientRequestDto request)
{
if (await _clientRepository.ExistsByNameAsync(request.Name))
{
return Result.Create<ClientDto>(
actionType: ActionType.VALIDATION_ERROR,
message: "A client with this name already exists."
);
}
var client = new Client(Guid.NewGuid(), request.Name);
await _clientRepository.AddAsync(client);
var clientDto = new ClientDto { Id = client.Id, Name = client.Name };
return Result.Create(
actionType: ActionType.CREATE,
message: "Client created successfully.",
data: clientDto
);
}
Deleting a Client
public async Task<Response<bool>> DeleteAsync(Guid id)
{
var client = await _clientRepository.GetByIdAsync(id);
if (client is null)
{
return Result.Create<bool>(
actionType: ActionType.NOT_FOUND,
message: "Client not found."
);
}
await _clientRepository.DeleteAsync(id);
return Result.Create<bool>(
actionType: ActionType.DELETE,
message: "Client deleted successfully."
);
}
📌 Output Example
Client Not Found (404)
{
"isSuccess": false,
"message": "Client not found.",
"statusCode": 404
}
Client Created Successfully (201)
{
"isSuccess": true,
"message": "Client created successfully.",
"statusCode": 201,
"data": {
"id": "bf5d9501-032f-447b-bfaf-8cc4fff19e61",
"name": "Teste"
}
}
Client Already Exists (400)
{
"isSuccess": false,
"message": "A client with this name already exists.",
"statusCode": 400
}
Client Deleted Successfully (200)
{
"isSuccess": true,
"message": "Client deleted successfully.",
"statusCode": 200
}
🎯 Features
- Standardized API response format
- Built-in status codes and messages
- Easy integration with Clean Architecture
- Fully compatible with .NET 8
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Links
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.16 | 40 | 4/21/2025 |
1.0.15 | 463 | 3/25/2025 |
1.0.14 | 468 | 3/25/2025 |
1.0.13 | 461 | 3/25/2025 |
1.0.12 | 324 | 3/24/2025 |
1.0.11 | 250 | 3/24/2025 |
1.0.10 | 250 | 3/23/2025 |
1.0.9 | 136 | 3/16/2025 |
1.0.8 | 122 | 3/16/2025 |
1.0.7 | 140 | 3/14/2025 |
1.0.6 | 137 | 3/14/2025 |
1.0.5 | 131 | 3/13/2025 |
1.0.4 | 133 | 3/13/2025 |
1.0.3 | 202 | 3/3/2025 |
1.0.2 | 184 | 3/3/2025 |
1.0.1 | 93 | 3/2/2025 |
1.0.0 | 82 | 3/2/2025 |