Documentation: Stivan.in EF Core Generator

App Demo

Table of Contents

1. Introduction

Welcome to the Stivan.in EF Core Generator! This tool is designed to dramatically accelerate your .NET development workflow by automating the creation of a robust data layer for your applications.

2. Getting Started: Your First Project in 5 Minutes

Define a Model: In the Models panel, type a name for your entity (e.g., Product) and click Add.
Add Properties: With your model selected, use the Properties panel to add its properties (e.g., Name, Price).
Edit Property Details: Click a property to open the Editor panel on the right. Here you can change its Type, mark it as IsRequired, etc.
Generate Your Code: Click the Download button, confirm your project name, and download the "EF Core App".
Receive Your .ZIP File: You will get a .zip archive with your C# code organized into Models, Data, and ViewModels folders.

3. The Interface: A Deeper Dive

The application is divided into three main columns: The Models List (left), the Properties/Members List (center), and the main Editor (right).

4. Core Concepts: Defining Relationships

Correctly defining relationships is the most powerful feature of this tool. This is done by setting the PropertyKind and InverseNavigationPropertyName on both sides of the relationship.

Key Fields

5. Importing and Exporting Your Schema

Use the Import button to load a .json schema file, and use the Download button with the "JSON" option selected to save your work.

6. Using the Generated Code

After you download the .zip file, follow these steps to integrate it into a new project.

Step 1: Create a New Project

Open your terminal and create a new ASP.NET Core Web API project.

dotnet new webapi -n MyAwesomeApp
cd MyAwesomeApp

Step 2: Add EF Core Packages

Install the required NuGet packages for Entity Framework Core.

dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.EntityFrameworkCore.Design

Step 3: Copy Generated Files

Unzip the downloaded archive and copy the Models, Data, and ViewModels folders into your new project's root directory.

Step 4: Configure DbContext

Open Program.cs and add the necessary lines to register your DbContext with dependency injection.

// Add these using statements at the top
using Microsoft.EntityFrameworkCore;
using MyAwesomeApp.Data;
builder.Services.AddDbContext<MyAwesomeAppDbContext>(options =>
    options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));

Step 5: Add Connection String

Open appsettings.json and add your database connection string.

"ConnectionStrings": {
  "DefaultConnection": "Server=.;Database=MyAwesomeDb;Trusted_Connection=True;TrustServerCertificate=True;"
}

Step 6: Create & Update Database

Run the final commands in your terminal to create the migrations and apply them to your database.

dotnet ef migrations add InitialCreate
dotnet ef database update

7. Frequently Asked Questions (FAQ)

Is this tool free?

Yes, the Stivan.in EF Core Generator is completely free to use.

Is my schema data secure?

Yes. The schema data you provide is processed in-memory on our server solely to generate your code. We do not store or log your designs after the generation process is complete.

How do I report a bug or request a feature?

We welcome all feedback! For inquiries or direct support, please send an email to our support team.

You're All Set!

You are now ready to build amazing applications. We hope this tool helps accelerate your development process.