ORM Scaffold for SqlServer (database first)
$ dotnet add package Niubility.Scaffold.Database.SqlServer> dotnet add package Niubility.Scaffold.Database.SqlServer --version 1.2.5
Note: replace all <NEEDTOSET> to your needs
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ output extension="\\" #>
<#@ include file="$(NuGetPackageRoot)niubility.scaffold.database.sqlserver\1.2.5\contentFiles\Scaffold.ttinclude" #>
<#
//// the connection string of your database which need to setting up repository and entity class through scaffold
var connectionString = "<NEEDTOSET>";
var settings = new DatabaseScaffoldSettings(connectionString)
{
//// all of below is optional
//// the folder which will store the repository and entity class file
OutputDirectory = "Database",
SolutionName = "Demo",
//// which namespace the repository and entity class will be located
DatabaseRepositoryNamespace = "{RootNamespace}.Repository",
//// OnlySchemas = new string[] {},
//// ExcludeSchemas = new string[] {},
//// OnlyTableNames = new string[] {},
//// ExcludeTableNames = new string[] {},
};
#>
<#
Generate(settings);
#>