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.
#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
7.0.191 321 4/6/2025
7.0.189 8,254 3/19/2024
7.0.187 276 3/17/2024
6.3.185 222 3/15/2024
6.3.183 270 3/15/2024
6.3.181 218 3/14/2024
6.3.179 254 3/14/2024
6.3.177 238 3/14/2024
6.2.175 302 3/1/2024
6.2.173 260 3/1/2024
6.2.172 221 3/1/2024
6.1.166 2,640 11/18/2023
6.1.164 10,880 3/25/2023
6.0.162 3,006 12/26/2022
6.0.161 446 12/26/2022
5.2.159 7,031 6/30/2022
5.2.158 591 6/30/2022
5.2.155 5,476 3/29/2022
5.2.154 621 3/27/2022
5.1.152 1,233 1/5/2022
5.0.151 394 1/5/2022
5.0.150 386 1/5/2022
5.0.149 413 1/3/2022
5.0.148 382 1/3/2022
5.0.147 403 1/3/2022
5.0.146 430 1/3/2022
5.0.145 406 1/3/2022
5.0.144 388 1/3/2022
5.0.143 376 1/3/2022
4.1.134 372 12/22/2021
4.1.133 373 12/21/2021
4.1.132 350 12/21/2021
4.1.131 342 12/20/2021
4.1.130 376 12/20/2021
4.1.129 366 12/20/2021
4.0.127 1,228 11/20/2021
3.2.124 428 11/18/2021
3.2.123 372 11/18/2021
3.2.121 376 11/17/2021
3.2.120 360 11/17/2021
3.1.118 382 11/17/2021
3.0.115 542 11/7/2021
3.0.114 416 11/4/2021
3.0.113 402 11/4/2021
3.0.112 394 11/4/2021
3.0.111 432 11/4/2021
3.0.109 435 11/4/2021
3.0.108 466 11/4/2021
2.2.1 3,988 7/7/2021
2.2.0 424 6/6/2021
2.1.0 434 5/25/2021
2.0.0 442 5/7/2021
1.1.5 451 4/28/2021
1.1.4 451 4/16/2021
1.1.3 585 4/12/2021 1.1.3 is deprecated because it is no longer maintained.