AspNetForge.WebCore 1.1.0

dotnet add package AspNetForge.WebCore --version 1.1.0
                    
NuGet\Install-Package AspNetForge.WebCore -Version 1.1.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.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AspNetForge.WebCore" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AspNetForge.WebCore" />
                    
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 AspNetForge.WebCore --version 1.1.0
                    
#r "nuget: AspNetForge.WebCore, 1.1.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.1.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.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AspNetForge.WebCore&version=1.1.0
                    
Install as a Cake Tool

AspNetForge.WebCore

Class Library + стартовый шаблон для ASP.NET Core Minimal API (.NET 8) с PostgreSQL. Содержит CRUD-эндпоинты, cookie-авторизацию, встроенные HTML/CSS/JS и готовый пример проекта.

Быстрый старт

dotnet new web -n MyWebApp
cd MyWebApp
dotnet add package AspNetForge.WebCore --version 1.1.0
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 8.0.11
dotnet build

Важно: пакет рассчитан на чистый проект dotnet new web. Он заменяет Program.cs, копирует wwwroot/, appsettings.json, SQL DDL.txt, блок-схема.vsdx, COMPOSITE_KEY.txt и папку help/.

Что происходит после установки

  1. Program.cs заменяется шаблонным примером (модели и DbContext находятся внутри него).
  2. wwwroot/ копируется с HTML/CSS/JS, логотипом и заглушкой для фото.
  3. appsettings.json, SQL DDL.txt, блок-схема.vsdx, COMPOSITE_KEY.txt и папка help/ копируются в корень проекта.

Настройка PostgreSQL

Откройте appsettings.json и проверьте строку подключения:

{
  "ConnectionStrings": {
    "DefaultConnection": "Host=localhost;Port=5432;Database=examdb;Username=postgres;Password=postgres"
  }
}

Создайте базу:

CREATE DATABASE examdb;

Запустите приложение:

dotnet run

Роли

В шаблоне используется роль Admin. Администратор может добавлять/редактировать/удалять товары и заказы. Неавторизованный пользователь (гость) видит только списки.

Подсветка строк товаров

  • скидка > 15% — фон #483D8B;
  • товара нет на складе (Quantity == 0) — красный фон;
  • при скидке старая цена перечёркивается, рядом выводится цена со скидкой.

Составной ключ

Универсальный MapCrud составной ключ не поддерживает. Подробная инструкция — в файле COMPOSITE_KEY.txt.

Возможные ошибки

CS0234: EntityFrameworkCore не существует

dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 8.0.11

wwwroot пустой

Закройте Visual Studio, удалите папку obj/, откройте решение заново и нажмите Ctrl+Shift+B.

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

Version Downloads Last Updated
1.1.0 128 6/15/2026
1.0.9 120 6/14/2026
1.0.8 116 6/14/2026
1.0.7 116 6/14/2026
1.0.6 112 6/14/2026
1.0.5 116 6/14/2026
1.0.4 114 6/14/2026
1.0.3 116 6/13/2026
1.0.2 119 6/12/2026
1.0.1 119 6/12/2026
1.0.0 115 6/12/2026