![]() |
VOOZH | about |
dotnet add package Grad.CsLib --version 2.0.12
NuGet\Install-Package Grad.CsLib -Version 2.0.12
<PackageReference Include="Grad.CsLib" Version="2.0.12" />
<PackageVersion Include="Grad.CsLib" Version="2.0.12" />Directory.Packages.props
<PackageReference Include="Grad.CsLib" />Project file
paket add Grad.CsLib --version 2.0.12
#r "nuget: Grad.CsLib, 2.0.12"
#:package Grad.CsLib@2.0.12
#addin nuget:?package=Grad.CsLib&version=2.0.12Install as a Cake Addin
#tool nuget:?package=Grad.CsLib&version=2.0.12Install as a Cake Tool
This package contains utilities for C# API projects.
This package is very opinionated, as it's intended for Graduate College API projects:
/spec folder for generating client libraries.
Outside of Microsoft packages, these are the main dependencies:
CsLibWebHere's an example of how to set up a Program.cs file for a web API project:
using ExampleData;
using ExampleServer;
using FastEndpoints.ClientGen.Kiota;
using Grad.CsLib;
using Microsoft.EntityFrameworkCore;
using Serilog;
var builder = WebApplication.CreateBuilder(args);
builder.AddSwagger(args, "ExampleServer", "0.0.1", "Example Backend Server");
builder
.AddSerilog()
.AddCors()
.AddAuth();
builder.Services
.AddDbContext<ExampleContext>(options =>
options.UseSqlServer(
builder.Configuration.GetConnectionString("Example")))
.AddAuthorization(AuthPolicy.AddAuthPolicy)
.RegisterServicesFromExampleServer();
builder.AddEndpoints(DiscoveredTypes.All);
try
{
var app = builder.BuildAndConfigureApp(b => b.ReflectionCache.AddFromExampleData().AddFromExampleServer());
// This is only run with the --exportswaggerjson option
await app.ExportSwaggerJsonAndExitAsync("ExampleServer", "../spec");
app.Run();
}
catch (Exception ex)
{
Log.Fatal(ex, "Application start-up failed");
}
finally
{
Log.CloseAndFlush();
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.