Skip to content

Instantly share code, notes, and snippets.

@ParmanBabra
Created May 20, 2019 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ParmanBabra/f86fe6355d5825076d680d8021e298c0 to your computer and use it in GitHub Desktop.
Save ParmanBabra/f86fe6355d5825076d680d8021e298c0 to your computer and use it in GitHub Desktop.
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
...
modelBuilder.Entity<Product>(builder => // ระบุ Model ที่ต้องการ Map กับ Table
{
...
builder.Property(en => en.Weight)
.HasColumnName("Weight")
.HasColumnType<float>("decimal(12, 4)");
});
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment