C4Sharp 3.2.121

There is a newer version of this package available.
See the version list below for details.
dotnet add package C4Sharp --version 3.2.121
                    
NuGet\Install-Package C4Sharp -Version 3.2.121
                    
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="C4Sharp" Version="3.2.121" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="C4Sharp" Version="3.2.121" />
                    
Directory.Packages.props
<PackageReference Include="C4Sharp" />
                    
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 C4Sharp --version 3.2.121
                    
#r "nuget: C4Sharp, 3.2.121"
                    
#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 C4Sharp@3.2.121
                    
#: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=C4Sharp&version=3.2.121
                    
Install as a Cake Addin
#tool nuget:?package=C4Sharp&version=3.2.121
                    
Install as a Cake Tool

C4Sharp (C4S) is a .net library for building C4 Model diagrams. It's works like a superset of C4-PlantUML through which developers can create, share, and consume C4 Model diagrams as code (C#) such as Context, Container, Component and Deployment diagrams.

.NET CodeQL

Getting Started

Dependencies

You need these things to run C4Sharp:

Coding

To create C4S diagrams, we need a set of C4 structures and inform their Relationships, as shown in the following example:

structures

To start using C4S, you should create the basic structures of your architecture design, like this:


//Person
public static Person Customer => new Person("customer", "Personal Banking Customer")
{
    Description = "A customer of the bank, with personal bank accounts."
};

// Systems
public static SoftwareSystem BankingSystem => new SoftwareSystem("BankingSystem", "Internet Banking System")
{
    Description = "Allows customers to view information about their bank accounts, and make payments."
};

public static SoftwareSystem Mainframe => new SoftwareSystem("Mainframe", "Mainframe Banking System")
{
    Description = "Stores all of the core banking information about customers, accounts, transactions, etc.",
    Boundary = Boundary.External
};

public static SoftwareSystem MailSystem => new SoftwareSystem("MailSystem", "E-mail system")
{
    Description = "The internal Microsoft Exchange e-mail system.",
    Boundary = Boundary.External
};

Then, you'll be able to create a C4 Context Diagram:


var diagram = new ContextDiagram
{
    Title = "System Context diagram for Internet Banking System",
    Structures = new Structure[]
    {
        Customer,
        BankingSystem,
        Mainframe,
        MailSystem
    },
    Relationships = new []
    {
        (Customer > BankingSystem),
        (Customer < MailSystem)["Sends e-mails to"],
        (BankingSystem > MailSystem)["Sends e-mails", "SMTP"][Neighbor],
        (BankingSystem > Mainframe),
    }
};

new PlantumlSession()
    .UseDiagramImageBuilder()
    .UseStandardLibraryBaseUrl()
    .Export(diagrams);

See more in our sample code:

The result will be:

<p align="center"> <img src="https://raw.githubusercontent.com/8T4/c4sharp/main/docs/images/context-example.png" alt="logo" width='450' > </p>

Learn

To learn more about C4S access our wiki.

Thanks

C4 community

Contributors

Colleagues

Guide to contributing to a GitHub project

This is a guide to contributing to this open source project that uses GitHub. It’s mostly based on how many open sorce projects operate. That’s all there is to it. The fundamentals are:

  • Fork the project & clone locally.
  • Create an upstream remote and sync your local copy before you branch.
  • Branch for each separate piece of work.
  • Do the work, write good commit messages, and read the CONTRIBUTING file if there is one.
  • Push to your origin repository.
  • Create a new PR in GitHub.
  • Respond to any code review feedback.

If you want to contribute to an open source project, the best one to pick is one that you are using yourself. The maintainers will appreciate it!

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.
  • net5.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
8.0.199 131 7/19/2025
8.0.197 79 7/19/2025
8.0.195 80 7/19/2025
7.0.191 393 4/6/2025
7.0.189 9,127 3/19/2024
7.0.187 305 3/17/2024
6.3.185 250 3/15/2024
6.3.183 309 3/15/2024
6.3.181 246 3/14/2024
6.3.179 284 3/14/2024
6.3.177 267 3/14/2024
6.2.175 331 3/1/2024
6.2.173 290 3/1/2024
6.2.172 256 3/1/2024
6.1.166 2,658 11/18/2023
6.1.164 11,193 3/25/2023
6.0.162 3,040 12/26/2022
6.0.161 475 12/26/2022
5.2.159 7,072 6/30/2022
5.2.158 624 6/30/2022
5.2.155 5,621 3/29/2022
5.2.154 662 3/27/2022
5.1.152 1,267 1/5/2022
5.0.151 428 1/5/2022
5.0.150 429 1/5/2022
5.0.149 447 1/3/2022
5.0.148 415 1/3/2022
5.0.147 437 1/3/2022
5.0.146 467 1/3/2022
5.0.145 439 1/3/2022
5.0.144 423 1/3/2022
5.0.143 410 1/3/2022
4.1.134 407 12/22/2021
4.1.133 407 12/21/2021
4.1.132 396 12/21/2021
4.1.131 377 12/20/2021
4.1.130 415 12/20/2021
4.1.129 398 12/20/2021
4.0.127 1,263 11/20/2021
3.2.124 463 11/18/2021
3.2.123 405 11/18/2021
3.2.121 410 11/17/2021
3.2.120 395 11/17/2021
3.1.118 415 11/17/2021
3.0.115 576 11/7/2021
3.0.114 450 11/4/2021
3.0.113 435 11/4/2021
3.0.112 428 11/4/2021
3.0.111 466 11/4/2021
3.0.109 473 11/4/2021
3.0.108 501 11/4/2021
2.2.1 4,044 7/7/2021
2.2.0 459 6/6/2021
2.1.0 468 5/25/2021
2.0.0 478 5/7/2021
1.1.5 493 4/28/2021
1.1.4 484 4/16/2021
1.1.3 646 4/12/2021 1.1.3 is deprecated because it is no longer maintained.