Skip to content


Switch branches/tags


Failed to load latest commit information.
Latest commit message
Commit time
Jun 24, 2022
Mar 16, 2022
Apr 7, 2022
Mar 14, 2022
Mar 14, 2022

image Getting Started | Samples | Walkthrough Video

Get fully working CRUD API's in an instant!

Build & Nuget Status

Version Build Nuget
Main 0.6.0
VNext 0.6.1-RC1


The API Generator automatically generates a fully working CRUD Microservice from just your Model (C# Classes) or a JSON Definition. Everything from routes, database handling, migrations, openapi spec, OData etc is working magically out of the box! You just write your model and get a fully working CRUD api with filtering, sorting, selectable fields and everything else OData and classic REST offers.

By using the API Generator, this little code snippet is already a working CRUD API

/// <summary>
/// This is the minimal sample, yes this is a working api ;)
/// </summary>
public class MinimalSample : IObjectBase<int>
  public int Id { get; set; }
  public string Name { get; set; }
  public int Value { get; set; }

Heres another sample:

 [Api("/people", ApiMethodsToGenerate.All )]
 public class Person : Trackable, 
    IBeforeUpdate<Person>, // Before Update Hook
    IBeforeDelete<Person>, // BeforeDelete Hook
    public string Name { get; set; }
    public DateTime Date { get; set; }
    public string Description { get; set; }
    public int Age { get; set; }
    public Guid Id { get; set; }

And this is also the FULL code for a working API using the JSON mode:

      "name": "Car",
      "route": "/cars",
      "caching": true,
      "cacheLiveTime": 1000,
      "events": "POST,PUT,DELETE",
      "idType":  "int", 
      "Fields": [
          "name": "Name",
          "type": "String",
          "maxLength": "200",
          "nullable": false

Getting Started & Docoumentation

Read this for a more detailed guide -> Or just follow these steps:

  • Install the package
dotnet add package TCDev.ApiGenerator --prerelease

after the package is installed add this to your program.cs (or startup.cs)

// Add API Generator and load data
                //From Assembly with OData .AddAssemblyWithOData(Assembly.GetExecutingAssembly())
                //or as JSON from Uri .AddAssemblyWithODataFromUri("","")
                //Or without OData .AddAssembly(Assembly.GetExecutingAssembly())
                .AddDataContextSQL() // or Postgres or SQLite



You can find samples for using the library in the samples repository, constantly updated to match latest version and features: