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

Remove Column Property to support for changing Database Type #200

Open
vuminhquang opened this issue Nov 23, 2020 · 0 comments
Open

Remove Column Property to support for changing Database Type #200

vuminhquang opened this issue Nov 23, 2020 · 0 comments

Comments

@vuminhquang
Copy link

Hello Loresoft,

  1. When using Code-First, it's easy to change database file: for example
  • options.UseSqlite(connectionString)
  • options.UseSqlserver(connectionString)
    2, The code generate by efg is not that flexible since:
  • efg create mapping file with db specific type such as:
    builder.Property(t => t.Id)
    .IsRequired()
    .HasColumnName("Id")
    .HasColumnType("int")
    .ValueGeneratedOnAdd();
  • The specific ColumnType is not required with entity framework, it can generate automatically based on the model fields => the needed code is only:
    builder.Property(t => t.Id)
    .IsRequired()
    .HasColumnName("Id")
    .ValueGeneratedOnAdd();
    By remove // .HasColumnType("int") our code can support to change db type again.
  1. So, Loresoft, can we have option not to generate ColumnType in our yml configuration file?
    Thank you.

Sincerely

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

1 participant