Skip to content

Instantly share code, notes, and snippets.

@ducmeit1
Created July 10, 2019 07:03
Show Gist options
  • Save ducmeit1/e089ad7e28fc5bb2ba5c935e7c510599 to your computer and use it in GitHub Desktop.
Save ducmeit1/e089ad7e28fc5bb2ba5c935e7c510599 to your computer and use it in GitHub Desktop.
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Demo.Configurations {
public sealed class UserConfiguration : IEntityTypeConfiguration<User>
{
public void Configure(EntityTypeBuilder<User> builder) {
builder.ToTable("UsersTbl");
builder.HasKey(u => u.Id);
builder.Property(u => u.FirstName).IsRequired();
builder.Property(u => u.LastName).IsRequired();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment