Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于FluentApi的table name问题 #387

Closed
pigwing opened this issue Jul 25, 2020 · 1 comment
Closed

关于FluentApi的table name问题 #387

pigwing opened this issue Jul 25, 2020 · 1 comment

Comments

@pigwing
Copy link
Contributor

pigwing commented Jul 25, 2020

[Table(Name = "table")]
    [Index("{tablename}-Index", "XId")]
    public class TModel
    {}
_freeSql.CodeFirst.ConfigEntity<TModel>(e =>
       {
              e.Name("1_table");
      });

当Model设置了[Table(Name = "table")]名称后,上面的FluentApi便使用Model的注解来做表名建表,但是对于postgresql而言.需要使用{tablename}作为占位符建立分表索引.目前的情况是.我Model手动写了注解,标识表明,但是使用FluentApi手动填写表名建表后,无法覆盖Model中注解写入的表名.导致建表不会出现1_table的表,实际表名是table

@2881099
Copy link
Collaborator

2881099 commented Jul 26, 2020

看得不是怎么理解,特性、fluentapi 有优先级:

数据库特性 > 实体特性 > FluentApi(配置特性) > Aop(配置特性)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants