WeihanLi.EntityFramework.DbDescriptionHelper
0.8.0
ef tool for generating database tables and columns description
Install-Package WeihanLi.EntityFramework.DbDescriptionHelper -Version 0.8.0
dotnet add package WeihanLi.EntityFramework.DbDescriptionHelper --version 0.8.0
<PackageReference Include="WeihanLi.EntityFramework.DbDescriptionHelper" Version="0.8.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WeihanLi.EntityFramework.DbDescriptionHelper --version 0.8.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WeihanLi.EntityFramework.DbDescriptionHelper, 0.8.0"
For F# scripts that support #r syntax, copy this into the source code to reference the package.
EntityFramework.DbDescriptionHelper, ef tool for generating database tables and columns description
(SqlServer only for now)
Get Started
- Add Attribute
// TableName equals the model's Name
[TableDescription("UserTable")]
public class User : BaseModel
{
[ColumnDescription("Username")]
public string Username { get; set; }
/// <summary>
/// 密码
/// </summary>
[ColumnDescription("PasswordHash")]
public string PasswordHash { get; set; }
[ColumnDescription("IsActive")]
public bool IsActive { get; set; }
}
// table name not equals the model's Name
[TableDescription("ShopRouteInfo", "RouteInfoTable")]
public class ShopRouteInfoModel:BaseModel
{
[ColumnDescription("RouteType,0:Area,1:Controller,2:Action")]
public int RouteType { get; set; }
[ColumnDescription("RouteInfoName")]
public string RouteInfoName { get; set; }
[ColumnDescription("RouteInfoDesc")]
public string RouteInfoDesc { get; set; }
[ColumnDescription("Parent RouteInfo")]
public int ParentId { get; set; }
}
- Add custom database initializer
please refer to the samples below
- Generate database description
// Generate databse description directly
new SqlServerDbDescriptionInitializer().GenerateDbDescription(context);
// Generate database description directly async
await new SqlServerDbDescriptionInitializer().GenerateDbDescriptionAsync(context);
// generate create databse description sql text
new SqlServerDbDescriptionInitializer().GenerateDbDescriptionSqlText(typeof(context));
EntityFramework.DbDescriptionHelper, ef tool for generating database tables and columns description
(SqlServer only for now)
Get Started
- Add Attribute
// TableName equals the model's Name
[TableDescription("UserTable")]
public class User : BaseModel
{
[ColumnDescription("Username")]
public string Username { get; set; }
/// <summary>
/// 密码
/// </summary>
[ColumnDescription("PasswordHash")]
public string PasswordHash { get; set; }
[ColumnDescription("IsActive")]
public bool IsActive { get; set; }
}
// table name not equals the model's Name
[TableDescription("ShopRouteInfo", "RouteInfoTable")]
public class ShopRouteInfoModel:BaseModel
{
[ColumnDescription("RouteType,0:Area,1:Controller,2:Action")]
public int RouteType { get; set; }
[ColumnDescription("RouteInfoName")]
public string RouteInfoName { get; set; }
[ColumnDescription("RouteInfoDesc")]
public string RouteInfoDesc { get; set; }
[ColumnDescription("Parent RouteInfo")]
public int ParentId { get; set; }
}
- Add custom database initializer
please refer to the samples below
- Generate database description
// Generate databse description directly
new SqlServerDbDescriptionInitializer().GenerateDbDescription(context);
// Generate database description directly async
await new SqlServerDbDescriptionInitializer().GenerateDbDescriptionAsync(context);
// generate create databse description sql text
new SqlServerDbDescriptionInitializer().GenerateDbDescriptionSqlText(typeof(context));
Release Notes
ef tool for generating database tables and columns description
Dependencies
-
.NETFramework 4.5
- EntityFramework (>= 6.1.3)
-
.NETStandard 2.0
- Microsoft.EntityFrameworkCore.SqlServer (>= 2.0.0)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version History
Version | Downloads | Last updated |
---|---|---|
0.8.0 | 852 | 9/15/2017 |