Getting Started

Project Setup

To start using Jenga.NET, First create a .NET Framework (4.7 >) WinForms project.

Organize the project using Folders (Recommended), Create the Models folder. This is where we will add the Jenga Models.

Install dependencies

Right click on the project, click manage nuget packages. (An active internet connection is required).

Search for Jenga.NET then install in.

Add Model Classes

Add a class to the models folder and name it user.

Include the namespaces:

using Kimtoo.DbManager;
using ServiceStack.DataAnnotations;
namespace HelloWorld.Models
{
    [AutoGenerateTable(0)]
    [JengaEntity]
    [Alias("users")]
    public class User
    {
        [PrimaryKey]
        [AutoIncrement]
        public int Id { get; set; }
        [JengaIdentifier]
        public string Name { get; set; }
        public string Phone { get; set; }
        public string Gender { get; set; }
        public string  Email { get; set; } 
        public int Age { get; set; }
    }
}

[AutogenerateTables] Attribute

This attribute enables Jenga.NET to autogenerate the table and its fields automatically if it does not exist. The integer parameter is the order of the table generation for related tables.

[AutogenerateTables] should always come on top of other attributes.

Parent tables should have lower order than the child tables

[JengaEntity] Attribute

This attribute identifies the class as a Jenga entity model. Classes without this attribute won't be visible on Jenga.NET.

Last updated