Levge.ConsistentResponse 1.1.45

dotnet add package Levge.ConsistentResponse --version 1.1.45
                    
NuGet\Install-Package Levge.ConsistentResponse -Version 1.1.45
                    
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="Levge.ConsistentResponse" Version="1.1.45" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Levge.ConsistentResponse" Version="1.1.45" />
                    
Directory.Packages.props
<PackageReference Include="Levge.ConsistentResponse" />
                    
Project file
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 Levge.ConsistentResponse --version 1.1.45
                    
#r "nuget: Levge.ConsistentResponse, 1.1.45"
                    
#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.
#:package Levge.ConsistentResponse@1.1.45
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Levge.ConsistentResponse&version=1.1.45
                    
Install as a Cake Addin
#tool nuget:?package=Levge.ConsistentResponse&version=1.1.45
                    
Install as a Cake Tool

<img src="src/Levge.ConsistentResponse/icon.png" width="100" height="100" alt="Levge.ConsistentResponse logo" />

Levge.ConsistentResponse

NuGet Build

Levge.ConsistentResponse, .NET Web API projeleri i�in standartla�t�r�lm�� yan�t yap�lar�, geli�mi� hata y�netimi ve yard�mc� modeller sunan kapsaml� bir k�t�phanedir. API yan�tlar�n�z�n tutarl� olmas�n� sa�lar ve geli�tirme s�recini h�zland�r�r.

�zellikler

  • Tutarl� API Yan�tlar�: T�m endpoint'lerinizden ApiResponse<T> format�nda standart ��kt� alman�z� sa�lar.
  • Global Hata Y�netimi: �zel exception t�rleri (LevgeException vb.) ve beklenmeyen hatalar i�in merkezi bir middleware i�erir.
  • Model Do�rulama (Validation): Ge�ersiz model durumlar�n� (ModelState) otomatik olarak yakalar ve anlaml� hata mesajlar� d�nd�r�r.
  • Sayfalama ve Filtreleme: Haz�r PaginationRequest, FilterOption, SortOption modelleri ile listeleme i�lemlerini kolayla�t�r�r.
  • URL D�n��t�rme: �ste�e ba�l� olarak URL'leri otomatik olarak kebab-case format�na �evirir (�rn: /api/user-profile).

Kurulum

NuGet paket y�neticisi ile projenize ekleyebilirsiniz:

dotnet add package Levge.ConsistentResponse

Kullan�m

K�t�phaneyi kullanmak i�in Program.cs dosyan�zda servis kayd�n� ve middleware eklemesini yapman�z yeterlidir.

1. Servis Kayd�

AddLevgeConsistentResponse metodu ile gerekli servisleri ve filtreleri ekleyin.

// Program.cs

var builder = WebApplication.CreateBuilder(args);

// ...

// Servisleri ekleyin (lowerUrls: true parametresi URL'lerin k���k harf/kebab-case olmas�n� sa�lar)
builder.Services.AddLevgeConsistentResponse(lowerUrls: true);

var app = builder.Build();

2. Middleware Aktivasyonu

UseLevgeConsistentResponse metodu ile global hata y�netimini devreye al�n. Bu sat�r�n di�er middleware'lerden �nce eklenmesi �nerilir.

// Program.cs

// ...

// Global exception handler'� ekleyin
app.UseLevgeConsistentResponse();

app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();

app.Run();

Yan�t Yap�s� �rnekleri

Ba�ar�l� Yan�t:

{
  "isSuccess": true,
  "message": "��lem ba�ar�l�.",
  "data": {
    "id": 1,
    "name": "�rnek Veri"
  },
  "errors": null
}

Hata Yan�t�:

{
  "isSuccess": false,
  "message": "Bir hata olu�tu.",
  "data": null,
  "errors": {
    "Email": [
      "Email alan� zorunludur."
    ]
  }
}
Product 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 is compatible.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.45 101 1/22/2026
1.1.44 327 6/25/2025
1.1.43 204 6/24/2025
1.1.42 210 6/24/2025
1.1.41 190 6/22/2025
1.1.35 163 6/22/2025
1.0.1 190 6/17/2025
1.0.0 210 6/17/2025