使用Sqlsugar生成实体的时候,为什么没有外键实体? 返回

SqlSugar 沟通中
4 263

Order,  OrderDetail  已经在OrderDetail添加OrderId 外键。

为什么自带的代码生成器 OrderDetail没有生成Order导航属性?


            var db1 = new SqlSugarScope(new ConnectionConfig()

            {

                ConnectionString = "Server=120.0.0.1,11143;Database=erp-po;User Id=sa;Password=liang1@12345;",

                DbType = DbType.SqlServer,

                IsAutoCloseConnection = true,

                InitKeyType = InitKeyType.Attribute, 

            }); 

            db1.DbFirst.IsCreateAttribute().CreateClassFile(@"..\..\..\..\Erp.Po.Data.Entity\", "Erp.Po.Data.Entity");


  


热忱回答4

  • fate sta fate sta VIP0
    1个月前

    sqlsugar操作库不依赖外键

    0 回复
  • kingbor kingbor VIP0
    1个月前

    @fate sta:怎么样才能生成 实体对象的导航属性呢?  要使用第三方模板或自己 写代码实现?

    0 回复
  • fate sta fate sta VIP0
    1个月前

    @kingbor:用局部类。用到导航的时候自个写。 

    0 回复
  • fate sta fate sta VIP0
    1个月前

    我记得默认生成的class就是partial类

    0 回复