GTM.Common 0.0.3

Suggested Alternatives

Raptor.Common

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package GTM.Common --version 0.0.3
                    
NuGet\Install-Package GTM.Common -Version 0.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="GTM.Common" Version="0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GTM.Common" Version="0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="GTM.Common" />
                    
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 GTM.Common --version 0.0.3
                    
#r "nuget: GTM.Common, 0.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.
#:package GTM.Common@0.0.3
                    
#: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=GTM.Common&version=0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=GTM.Common&version=0.0.3
                    
Install as a Cake Tool

Common Library

NuGet Version

Reusable library for building clean, decoupled, and resilient APIs.

This package provides components to facilitate the development of modern APIs and microservices, including:

  • Result modeling (Result, SuccessResult, FailureResult)

  • Error wrappers (BusinessRuleException, ErrorList)

  • Interfaces for clean architecture (IInteractor, IPresenter, IResponse, etc.)

  • Centralized HTTP API client (HttpApiClient)

  • Logging extensions for Serilog + Seq


📦 Installation

Install the package from nuget.org:

dotnet add package Common

Or add it to your .csproj:

<PackageReference Include="Common" Version="x.y.z" />

Replace x.y.z with the latest available version.


⚙️ Requirements

  • .NET 8 SDK

  • Compatible with ASP.NET Core, domain libraries, and microservices.


🚀 Basic Usage

Standard responses with Result:

using Common;

Result<string> result = Result.OK("All good");

// For errors
Result<string> error = Result.Fail<string>("Something went wrong");


Clean Architecture example:

public class GetUserInteractor : IResultInteractor<GetUserRequest, UserDto>
{
    public Task<Result<UserDto>> Handle(GetUserRequest request, CancellationToken cancellationToken)
    {
        if (request.Id <= 0)
            return Task.FromResult(Result.Fail<UserDto>("Invalid ID"));

        var user = new UserDto { Id = request.Id, Name = "Example" };
        return Task.FromResult(Result.OK(user));
    }
}


Centralized HTTP Client (HttpApiClient):

var client = new HttpApiClient("https://api.example.com/");
var response = await client.GetAsync<MyResponse>("endpoint");


🧩 Logging with Serilog + Seq

Add the following to your appsettings.json:

"CustomLogging": {
  "Project": "MyApiProject",
  "SeqUri": "http://localhost:5341",
  "LogEventLevel": "Information"
}

Then register the services:

builder.Services.AddLoggingServices(configuration);


🤝 Contributions

This package is designed for internal use, but feel free to open issues or pull requests for improvements or suggestions.


📝 License

Distributed under the MIT License. See the LICENSE file for more details.


Built with ❤️ by the development team.

¿Quieres que lo suba a un README.md limpio o lo formateamos de alguna forma especial para NuGet?

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 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.  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