UmlKit 8.6.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 UmlKit --version 8.6.0
NuGet\Install-Package UmlKit -Version 8.6.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="UmlKit" Version="8.6.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UmlKit" Version="8.6.0" />
<PackageReference Include="UmlKit" />
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 UmlKit --version 8.6.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: UmlKit, 8.6.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 UmlKit@8.6.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=UmlKit&version=8.6.0
#tool nuget:?package=UmlKit&version=8.6.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
UmlKit
Генерация UML/ER-диаграмм из EF Core DbContext за одну строку кода (.NET 8).
Установка
dotnet add package UmlKit
Возможности
- Диаграммы классов в формате PlantUML
- ER-диаграммы в формате Mermaid (отображаются на GitHub, GitLab)
- Простая текстовая ER-диаграмма
- Экспорт в Draw.io (XML-формат)
- Автоматическое определение первичных и внешних ключей
- Отображение связей между сущностями
Быстрый старт
PlantUML
using UmlKit;
string plantuml = UmlGenerator.ToPlantUml(db);
File.WriteAllText("diagram.puml", plantuml);
Mermaid (для GitHub)
string mermaid = UmlGenerator.ToMermaid(db);
File.WriteAllText("diagram.md", "```mermaid\n" + mermaid + "\n```");
Текстовый формат
string text = UmlGenerator.ToText(db);
Console.WriteLine(text);
Draw.io
// Получить XML-строку
string xml = UmlGenerator.ToDrawIo(db);
// Или сохранить сразу в файл
UmlGenerator.SaveDrawIo(db, "diagram.drawio");
Пример: пункт 1 билета -- диаграммы UML из кода за 1 строку
public partial class MainForm : Form
{
private void btnExportUml_Click(object sender, EventArgs e)
{
using var db = new AppDbContext();
// PlantUML — для подробных диаграмм классов
string puml = UmlGenerator.ToPlantUml(db);
File.WriteAllText("diagram.puml", puml);
// Mermaid — для отображения на GitHub
string mermaid = UmlGenerator.ToMermaid(db);
File.WriteAllText("er-diagram.md", "```mermaid\n" + mermaid + "\n```");
// Draw.io — для редактирования в визуальном редакторе
UmlGenerator.SaveDrawIo(db, "diagram.drawio");
// Текстовый — для вывода в консоль или TextBox
string text = UmlGenerator.ToText(db);
textBoxDiagram.Text = text;
MessageBox.Show("Диаграммы сохранены!");
}
}
Пример вывода (PlantUML)
@startuml
class Vacancy {
+int Id <<PK>>
+string Title
+decimal Salary
+int DepartmentId <<FK>>
}
class Department {
+int Id <<PK>>
+string Name
}
Department "1" --> "*" Vacancy
@enduml
Пример вывода (Mermaid)
erDiagram
Vacancy {
int Id PK
string Title
decimal Salary
int DepartmentId FK
}
Department {
int Id PK
string Name
}
Department ||--o{ Vacancy : has
Описание методов
| Метод | Описание |
|---|---|
UmlGenerator.ToPlantUml(db) |
Диаграмма классов в формате PlantUML |
UmlGenerator.ToMermaid(db) |
ER-диаграмма в формате Mermaid |
UmlGenerator.ToText(db) |
Текстовая ER-диаграмма |
UmlGenerator.ToDrawIo(db) |
Диаграмма в XML-формате Draw.io |
UmlGenerator.SaveDrawIo(db, path) |
Сохранение Draw.io диаграммы в файл |
Требования
- .NET 8.0
- Entity Framework Core
Лицензия
MIT
| 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
- Microsoft.EntityFrameworkCore (>= 8.0.25)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on UmlKit:
| Package | Downloads |
|---|---|
|
ISBuilder
Information System Builder — full toolkit for building .NET 8 WinForms applications with EF Core, SQL Server. Export, CRUD, forms, charts, auth, reports, validation, themes. |
GitHub repositories
This package is not used by any popular GitHub repositories.