...

/

Challenge Solution: Reverse Engineering

Challenge Solution: Reverse Engineering

Review the solution to reverse engineering a school database.

Overview

Below is the project provided for the reverse engineering challenge:

{
    "version": "0.2.0",
    "configurations": [
        {
            // Use IntelliSense to find out which attributes exist for C# debugging
            // Use hover for the description of the existing attributes
            // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            // If you have changed target frameworks, make sure to update the program path.
            "program": "${workspaceFolder}/bin/Debug/net6.0/ScaffoldDB.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
            "console": "internalConsole",
            "stopAtEntry": false
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach"
        }
    ]
}
Challenge on reverse engineering

Solving the challenge

Let’s solve the challenge using the dotnet ef dbcontext scaffold command. Click the “Run” button on the SPA widget above, and then execute the code below in the terminal:

Press + to interact
dotnet ef dbcontext scaffold "data source=output/School.db" Microsoft.EntityFrameworkCore.Sqlite --output-dir Models/Entities --context-dir Models/Data

In the first argument, after the ...