DotNet
Overview
The .NET generator works by reading your JSON models and creating corresponding C# Models and Controllers.
Configuration
Add "dotnet" to your back-end in config.json:
{
"back-end": ["dotnet"]
}
Generated Structure
The Generator will output the following in the dotnet/ directory:
Models/: Contains C# classes representing your database tables.Controllers/: ContainsApiControllerclasses with basic CRUD operations.
Model Example
using System;
using System.Collections.Generic;
namespace DotNetApp.Models
{
public class User
{
public long Id { get; set; }
public string Name { get; set; }
// ... other properties
}
}
Controller Example
using Microsoft.AspNetCore.Mvc;
// ...
namespace DotNetApp.Controllers
{
[ApiController]
[Route("api/[controller]")]
public class UserController : ControllerBase
{
// GET, POST, PUT, DELETE methods
}
}