Skip to content

Instantly share code, notes, and snippets.

@changhuixu
Created September 5, 2019 20:03
Show Gist options
  • Save changhuixu/da3e0d28226b1d774197477c7530dc2f to your computer and use it in GitHub Desktop.
Save changhuixu/da3e0d28226b1d774197477c7530dc2f to your computer and use it in GitHub Desktop.
internal class BankAccountEntityTypeConfigurationSqlite : IEntityTypeConfiguration<BankAccount>
{
public void Configure(EntityTypeBuilder<BankAccount> builder)
{
builder.ToTable("BankAccounts");
builder.HasKey(x => x.Id);
builder.Property(x => x.Id).HasColumnName("Id").ValueGeneratedOnAdd();
builder.Property(x => x.Balance).HasColumnName("Balance").HasConversion<double>()
.IsConcurrencyToken();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment