Dot Net Core 3.1 Code generator v1.0

This will generate repository pattern classess, razor views, controller, api controller, meme cache, validations and auto mapping
For feedback and bugs please feel free to reach us support at cuetech dot in

  • The name of primary key field should be ID
  • Only one primary key allowed per table
  • First field should be the primary key
Generated code
# Names & Default Length Keys & Props Visibility & Functions Relations Validations
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

Readme

The generated code is tested against dot net core 3.1

Database tested SQL Server, MySql, SqLite and PostgreSQL

Steps

  1. Create Dot Net Core 3.1 web application
  2. Add these packages
    1. <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.0" />
    2. <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
    3. <PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.7" />
    4. <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.8" />
    5. <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.8" />
    6. <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.8" />
    7. <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="3.1.8" />
    8. <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.8" />
    9. <!-- If you want to use another database , uncomment the relevant one and change the connecting part inside startup <PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.22" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.8" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />-->
    10. <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.8"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference>
    11. <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.5" />
    12. <PackageReference Include="System.Drawing.Common" Version="5.0.0" />
    13. <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.8.0" />
    14. <PackageReference Include="System.Runtime.Caching" Version="4.7.0" />
    15. <PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.10" />
  3. Create database in SQL Server or your desired database
  4. Add relevant connection string to appsettings.json
    "ConnectionStrings": { "Sql": "Data Source=JINSPC\\SQLEXPRESS2012;Initial Catalog=DotCoreCodeGen;persist security info=True;user id=sa;password=123456", "MySql": "server=localhost;port=3306;database=DotCoreCodeGen;uid=root;password=123456", "SqLite": "DataSource=DotCoreCodeGen.db;", "PostgreSQL": "host=localhost;database=DotCoreCodeGen;user id=postgres;password=123456" },
  5. Generate code through this page
  6. Create pages and folders as per the Namespace structure
  7. Paste the code from this page to your newly created pages
  8. Compile your project
  9. After copying do migration commands in package manager console
    add-migration first
    update-database

Response Model

Edit View

Validations

Unit Of Work

Startup

Memcache

Model

DTO

DB Context entries

Mapping

Interfaces

Service

Controller

Index View

Create View

Edit View

API

Your data

Save it as a json. You can later load it again !!!!

to do logger password dto only field