Skip to content

Instantly share code, notes, and snippets.

@MirzaLeka
Last active May 10, 2026 22:07
Show Gist options
  • Select an option

  • Save MirzaLeka/f2f10b5ea9e1c2f4d65acc13e5b7026b to your computer and use it in GitHub Desktop.

Select an option

Save MirzaLeka/f2f10b5ea9e1c2f4d65acc13e5b7026b to your computer and use it in GitHub Desktop.
Mermaid.js diagram as code

Code analyzed by Claude. Output is a sequence diagram for Mermaid.js.

POST /api/games/NewGameMode — Create

sequenceDiagram
    participant Client
    participant GamesController
    participant GamesService
    participant GamesContext
    participant SQL as SQL Server (Game_Modes)

    Client->>GamesController: POST /api/games/NewGameMode — { title, shortTitle, gameType }
    GamesController->>GamesService: CreateGameMode(CreateGameModeDTO)
    GamesService->>GamesService: new GameModes { Title, ShortTitle, GameType }
    GamesService->>GamesContext: GameModes.Add(newGameMode)
    GamesService->>GamesContext: SaveChangesAsync()
    GamesContext->>SQL: INSERT INTO Game_Modes (Title, Short_Title, Game_Type) VALUES (...)
    SQL-->>GamesContext: auto-generated ID
    GamesContext-->>GamesService: entity with new ID populated
    GamesService->>GamesService: GetGameModeDTO.ToResponse(entity)
    GamesService-->>GamesController: GetGameModeDTO
    GamesController-->>Client: 200 OK — { id, title, shortTitle }
Loading

Raw code

Surround the code block with three backticks (`) or three colons (:), followed by the text "mermaid".

:::mermaid
sequenceDiagram
    participant Client
    participant GamesController
    participant GamesService
    participant GamesContext
    participant SQL as SQL Server (Game_Modes)

    Client->>GamesController: POST /api/games/NewGameMode — { title, shortTitle, gameType }
    GamesController->>GamesService: CreateGameMode(CreateGameModeDTO)
    GamesService->>GamesService: new GameModes { Title, ShortTitle, GameType }
    GamesService->>GamesContext: GameModes.Add(newGameMode)
    GamesService->>GamesContext: SaveChangesAsync()
    GamesContext->>SQL: INSERT INTO Game_Modes (Title, Short_Title, Game_Type) VALUES (...)
    SQL-->>GamesContext: auto-generated ID
    GamesContext-->>GamesService: entity with new ID populated
    GamesService->>GamesService: GetGameModeDTO.ToResponse(entity)
    GamesService-->>GamesController: GetGameModeDTO
    GamesController-->>Client: 200 OK — { id, title, shortTitle }
:::
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment