AspNetForge.WebCore
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package AspNetForge.WebCore --version 1.0.0
NuGet\Install-Package AspNetForge.WebCore -Version 1.0.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="AspNetForge.WebCore" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AspNetForge.WebCore" Version="1.0.0" />
<PackageReference Include="AspNetForge.WebCore" />
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 AspNetForge.WebCore --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AspNetForge.WebCore, 1.0.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.
#:package AspNetForge.WebCore@1.0.0
#: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=AspNetForge.WebCore&version=1.0.0
#tool nuget:?package=AspNetForge.WebCore&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AspNetForge.WebCore
Class Library для ASP.NET Core Minimal API (.NET 8).
Возможности
MapCrud<TEntity, TContext>(this WebApplication app, string route)— создаёт 5 стандартных эндпоинтов: GET, GET by id, POST, PUT, DELETE.UseForgeResources(this WebApplication app, bool overwrite = false)— распаковывает встроенные JS/CSS/HTML вwwwrootприложения.- В комплект пакета входит полный пример проекта в
contentFiles— при установке в целевой проект копируютсяModels.cs,Program.csиwwwroot/.
Установка
dotnet add package AspNetForge.WebCore --version 1.0.0
После установки обязательно добавьте провайдер БД (пакет НЕ включает эти зависимости):
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 8.0.11
Если нужны JWT или Identity, установите их отдельно.
Использование
using AspNetForge.Web.Extensions;
var app = builder.Build();
app.UseForgeResources(overwrite: true);
app.UseDefaultFiles();
app.UseStaticFiles();
app.MapCrud<ProductType, AppDbContext>("/api/producttypes");
app.MapCrud<MaterialType, AppDbContext>("/api/materialtypes");
app.MapCrud<Product, AppDbContext>("/api/products");
app.MapCrud<Partner, AppDbContext>("/api/partners");
app.Run();
Сборка пакета
cd tmp/AspNetForge.Web
dotnet build -c Release
.nupkg появится в bin/Release/.
Структура пакета
lib/net8.0/AspNetForge.WebCore.dll
build/AspNetForge.WebCore.targets
contentFiles/any/any/Sample/Models.cs
contentFiles/any/any/Sample/Program.cs
contentFiles/any/any/Sample/appsettings.json
contentFiles/any/any/Sample/wwwroot/...
build/AspNetForge.WebCore.targets копирует файлы примера из пакета в целевой проект при сборке. appsettings.json копируется только если его ещё нет в проекте — добавьте строку подключения к PostgreSQL вручную.
| Product | Versions 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.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.