KarcagS.API.Shared 6.1.2

dotnet add package KarcagS.API.Shared --version 6.1.2                
NuGet\Install-Package KarcagS.API.Shared -Version 6.1.2                
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="KarcagS.API.Shared" Version="6.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KarcagS.API.Shared --version 6.1.2                
#r "nuget: KarcagS.API.Shared, 6.1.2"                
#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 KarcagS.API.Shared as a Cake Addin
#addin nuget:?package=KarcagS.API.Shared&version=6.1.2

// Install KarcagS.API.Shared as a Cake Tool
#tool nuget:?package=KarcagS.API.Shared&version=6.1.2                

Guide

Attributes

MaxNumber

Validation attribute for a maximum number value.

MinNumber

Validation attribute for a minimum number value.

User

The Repository uses for automatic user id inject (current user).

Helpers

Write Helper

Contains general String converters.

DateHelper

Contains general String converters (from DateTime).

Middlewares

Database Migration

Automatic migration executing.

For the using you need to add into the Program.cs start flow.

Example of using the extension method:

var app = builder.Build();

app.Migrate<DbContext>();

The DbContext can be any Database Context class

Exception Handler

An exception handler interceptor. Any success request will be wrapped into a HttpResult class. This object will contains the result, the status code or the error list.

For the using:

var app = builder.Build();

app.UseMiddleware<HttpInterceptor>();

or

var app = builder.Build();

app.UseHttpInterceptor();

Important! For the using you have to add the LoggerService to the application. Further information below.

Tools

Controllers

Use MapperController for five general endpoint.

  • Get entity by Id
  • Get entitiy list
  • Create from a model
  • Update by model
  • Delete by Id

For the using: inherit Controller from the MapperController.

Important! Need at least one MapperRepository solution.

Email

Under construction.

Export

Under construction.

Repository

Contain general solution for the DbContext access for entities and provide mapping solution also.

Repository is a solution for basic DbContext transaction. MapperRepository provides mapping possibility.

Important! For the MapperRepository you need add AutoMapper to the application.

Services

Utils

Provides utils functionality for a WebAPI application.

Get current user from HttpContext or its properties like userId, userEmail, userName.

For the using:

var builder = WebApplication.CreateBuilder();
builder.Services.Configure<UtilsSettings>(builder.Configuration.GetSection("Utils"));
builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
builder.Services.AddScoped<IUtilsService, UtilsService<NoteWebContext>>();

Important! You have to add the HttpContextAccessor to your application and add UtilsSettings as configuration.

Logger

Provides basic logging functionality.

For the using:

var builder = WebApplication.CreateBuilder();
builder.Services.Configure<UtilsSettings>(builder.Configuration.GetSection("Utils"));
builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
builder.Services.AddScoped<IUtilsService, UtilsService<NoteWebContext>>();
builder.Services.AddScoped<ILoggerService, LoggerService>();
Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on KarcagS.API.Shared:

Package Downloads
KarcagS.API.Repository

Package Description

KarcagS.API.Table

Package Description

KarcagS.API.Http

Package Description

KarcagS.API

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.1.2 127 12/31/2024
6.1.1 124 12/29/2024
6.1.0 123 12/27/2024
6.0.1 112 12/23/2024
6.0.0 110 12/22/2024
5.0.6 233 3/24/2024
5.0.5 214 1/18/2024
5.0.4 247 12/30/2023
5.0.3 184 12/30/2023
5.0.2 262 11/26/2023
5.0.1 209 11/26/2023
5.0.0 234 11/18/2023
4.2.2 467 8/5/2023
4.2.1 252 8/4/2023
4.2.0 263 8/3/2023
4.1.12 275 8/1/2023
4.1.11 310 7/22/2023
4.1.10 291 7/22/2023
4.1.9 292 7/21/2023
4.1.8 261 7/16/2023
4.1.7 308 7/5/2023
4.1.6 305 7/3/2023
4.1.5 327 7/3/2023
4.1.4 302 7/3/2023
4.1.3 308 7/3/2023
4.1.2 346 7/3/2023
4.1.1 357 7/2/2023
4.1.0 314 6/29/2023
4.0.7 306 6/25/2023
4.0.6 374 6/14/2023
4.0.5 322 6/10/2023
4.0.4 340 6/4/2023
4.0.3 397 5/11/2023
4.0.2 324 5/11/2023
4.0.1 298 5/11/2023
4.0.0 347 5/6/2023