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.

EntityFramework.DbDescriptionHelper, ef tool for generating database tables and columns description
(SqlServer only for now)

Get Started

  1. 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; }
    }
  1. Add custom database initializer

please refer to the samples below

  1. 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

  1. 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; }
    }
  1. Add custom database initializer

please refer to the samples below

  1. 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

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 729 9/15/2017