Halifax.Api
0.0.20
See the version list below for details.
dotnet add package Halifax.Api --version 0.0.20
NuGet\Install-Package Halifax.Api -Version 0.0.20
<PackageReference Include="Halifax.Api" Version="0.0.20" />
paket add Halifax.Api --version 0.0.20
#r "nuget: Halifax.Api, 0.0.20"
// Install Halifax.Api as a Cake Addin #addin nuget:?package=Halifax.Api&version=0.0.20 // Install Halifax.Api as a Cake Tool #tool nuget:?package=Halifax.Api&version=0.0.20
Package | NuGet |
---|---|
Halifax.Api | |
Halifax.Core | |
Halifax.Models |
Halifax Service Foundation
Simplistic libraries for complex projects. Halifax libraries are designed to speed up API service development process by encapsulating common functionality required for all microservices, allowing developers to focus on the business logic instead of copy-pasting the boilerplate code from project to project. The libraries are focussed on the following aspects of any application:
- ✅ Exception handling
- ✅ API models
- ✅ Swagger
- ✅ JWT Auth
- ✅ Logging
- ✅ CORS
Installation
Install the API library using nuget package with Package Manager Console:
Install-Package Halifax.Api
Or using .NET CLI:
dotnet add package Halifax.Api
Getting Started
Please refer to the Peggy's Cove example API project Startup.cs file for more details but basically all you need is to have this in your startup class:
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddHalifax();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseHalifax();
}
}
This enables routing with controllers and exception handling.
Models
It's very beneficial if all API responses follow the same format. In order to achieve it there is a model called ApiResponse
. It's designed to return response data, empty data or error information in the same consistent format. Here are the main use cases:
// Return API response with your model
return ApiResponse.With(model);
// Return empty API response
return ApiResponse.Empty;
When API response is used for all APIs in the project the response will always be of a format:
{
data: {...} // your model
success: true/false,
error: { // null if successful
type: "ArgumentNullException",
message: "Email is required",
trace: "(126) ArgumentNullException was thrown ... (typical exception stack trace)"
}
}
MIT License
Copyright (c) 2020 Andrei M
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net5.0
- Halifax.Core (>= 0.0.19)
- Halifax.Models (>= 0.0.5)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 5.0.10)
- Swashbuckle.AspNetCore (>= 6.2.2)
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 |
---|---|---|
3.2.3 | 100 | 9/10/2024 |
3.2.2 | 424 | 8/7/2024 |
3.2.1 | 400 | 5/10/2024 |
3.2.0 | 136 | 3/22/2024 |
3.1.1 | 225 | 3/11/2024 |
3.1.0 | 291 | 2/11/2024 |
3.0.2 | 245 | 1/24/2024 |
3.0.1 | 485 | 11/27/2023 |
3.0.0 | 192 | 11/17/2023 |
2.0.9 | 160 | 10/30/2023 |
2.0.8 | 329 | 9/14/2023 |
2.0.7 | 317 | 8/16/2023 |
2.0.6 | 297 | 7/9/2023 |
2.0.5 | 557 | 3/20/2023 |
2.0.4 | 258 | 3/20/2023 |
2.0.3 | 455 | 2/24/2023 |
2.0.2 | 560 | 1/2/2023 |
2.0.1 | 318 | 1/2/2023 |
2.0.0 | 321 | 12/21/2022 |
1.3.21 | 352 | 12/13/2022 |
1.3.20 | 325 | 12/5/2022 |
1.3.19 | 321 | 12/5/2022 |
1.3.18 | 337 | 12/3/2022 |
1.3.17 | 584 | 10/16/2022 |
1.3.16 | 481 | 9/21/2022 |
1.3.15 | 585 | 8/19/2022 |
1.3.14 | 580 | 7/19/2022 |
1.3.13 | 485 | 7/11/2022 |
1.3.12 | 536 | 6/22/2022 |
1.3.11 | 497 | 6/20/2022 |
1.3.10 | 470 | 6/14/2022 |
1.3.9 | 450 | 6/13/2022 |
1.3.8 | 477 | 6/13/2022 |
1.3.7 | 443 | 6/11/2022 |
1.3.6 | 460 | 6/11/2022 |
1.3.5 | 600 | 6/1/2022 |
1.3.4 | 465 | 6/1/2022 |
1.3.3 | 468 | 6/1/2022 |
1.3.2 | 520 | 5/20/2022 |
1.3.1 | 685 | 4/17/2022 |
1.3.0 | 491 | 4/8/2022 |
1.2.1 | 590 | 3/12/2022 |
1.2.0 | 663 | 2/2/2022 |
1.1.5 | 468 | 12/31/2021 |
1.1.4 | 349 | 12/28/2021 |
1.1.3 | 417 | 12/19/2021 |
1.1.2 | 330 | 12/15/2021 |
1.1.1 | 315 | 12/15/2021 |
1.1.0 | 333 | 12/15/2021 |
1.0.7 | 323 | 12/10/2021 |
1.0.6 | 311 | 12/10/2021 |
1.0.5 | 304 | 12/10/2021 |
1.0.4 | 306 | 12/10/2021 |
1.0.3 | 308 | 12/10/2021 |
1.0.2 | 331 | 12/10/2021 |
1.0.1 | 322 | 12/10/2021 |
1.0.0 | 353 | 12/7/2021 |
0.3.0 | 545 | 12/6/2021 |
0.2.4 | 301 | 12/3/2021 |
0.2.3 | 355 | 11/22/2021 |
0.2.2 | 426 | 11/11/2021 |
0.2.1 | 353 | 11/11/2021 |
0.2.0 | 327 | 11/9/2021 |
0.1.1 | 340 | 11/3/2021 |
0.1.0 | 396 | 10/20/2021 |
0.0.22 | 401 | 10/20/2021 |
0.0.21 | 349 | 10/18/2021 |
0.0.20 | 367 | 10/4/2021 |
0.0.19 | 416 | 10/4/2021 |
0.0.18 | 341 | 10/4/2021 |
0.0.17 | 374 | 9/20/2021 |
0.0.16 | 344 | 9/16/2021 |
0.0.15 | 362 | 9/16/2021 |
0.0.14 | 441 | 9/8/2021 |
0.0.13 | 396 | 8/27/2021 |
0.0.12 | 368 | 8/27/2021 |
0.0.11 | 362 | 8/27/2021 |
0.0.10 | 362 | 8/17/2021 |
0.0.9 | 366 | 8/17/2021 |
0.0.8 | 358 | 8/12/2021 |
0.0.7 | 348 | 8/12/2021 |
0.0.6 | 355 | 8/11/2021 |
0.0.5 | 342 | 8/11/2021 |
0.0.4 | 383 | 8/10/2021 |
0.0.3 | 366 | 8/9/2021 |
0.0.2 | 361 | 8/9/2021 |
0.0.1 | 367 | 8/9/2021 |
v0.0.x - Initial release