Halifax.Core 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Halifax.Core --version 0.2.0                
NuGet\Install-Package Halifax.Core -Version 0.2.0                
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="Halifax.Core" Version="0.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Halifax.Core --version 0.2.0                
#r "nuget: Halifax.Core, 0.2.0"                
#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.
// Install Halifax.Core as a Cake Addin
#addin nuget:?package=Halifax.Core&version=0.2.0

// Install Halifax.Core as a Cake Tool
#tool nuget:?package=Halifax.Core&version=0.2.0                
Package NuGet
Halifax.Api     NuGet
Halifax.Core     NuGet
Halifax.Models     NuGet

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 Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Halifax.Core:

Package Downloads
Halifax.Api

Halifax Service Foundation API library

Halifax.Http

Halifax Service Foundation HttpClient library

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.0 71 11/19/2024
3.1.4 200 9/10/2024
3.1.3 497 8/7/2024
3.1.2 467 5/10/2024
3.1.1 319 3/11/2024
3.1.0 330 2/11/2024
3.0.2 264 1/24/2024
3.0.1 154 12/29/2023
3.0.0 575 11/17/2023
2.0.7 178 10/30/2023
2.0.6 332 9/14/2023
2.0.5 346 8/16/2023
2.0.4 347 7/9/2023
2.0.3 643 3/20/2023
2.0.2 270 3/20/2023
2.0.1 460 2/24/2023
2.0.0 624 12/21/2022
1.2.9 405 12/13/2022
1.2.8 1,102 10/16/2022
1.2.7 703 9/21/2022
1.2.6 782 8/19/2022
1.2.5 934 7/11/2022
1.2.4 993 6/22/2022
1.2.3 572 6/20/2022
1.2.2 561 6/14/2022
1.2.1 682 6/13/2022
1.2.0 426 6/13/2022
1.1.6 664 6/11/2022
1.1.5 1,452 6/1/2022
1.1.4 542 6/1/2022
1.1.3 539 6/1/2022
1.1.2 394 6/1/2022
1.1.1 650 5/20/2022
1.1.0 950 4/8/2022
1.0.3 793 3/12/2022
1.0.2 1,128 12/19/2021
1.0.1 612 12/10/2021
1.0.0 700 12/7/2021
0.3.0 563 12/6/2021
0.2.2 348 12/3/2021
0.2.1 389 11/22/2021
0.2.0 585 11/9/2021
0.1.1 434 11/3/2021
0.1.0 505 10/20/2021
0.0.21 423 10/20/2021
0.0.20 430 10/18/2021
0.0.19 593 10/4/2021
0.0.18 435 10/4/2021
0.0.17 513 9/16/2021
0.0.15 685 8/27/2021
0.0.14 533 8/27/2021
0.0.13 332 8/27/2021
0.0.12 334 8/27/2021
0.0.11 408 8/17/2021
0.0.10 323 8/17/2021
0.0.9 339 8/17/2021
0.0.8 335 8/16/2021
0.0.7 973 8/9/2021
0.0.6 542 8/9/2021
0.0.5 326 7/31/2021
0.0.4 353 7/31/2021
0.0.3 337 7/31/2021
0.0.2 331 7/31/2021
0.0.1 323 7/31/2021

v0.x.x - Initial release