Skip to content

Instantly share code, notes, and snippets.

@ParmanBabra
Last active May 25, 2019 19:36
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/378884cad3fea3c1e77963e3bce7d540 to your computer and use it in GitHub Desktop.
Save ParmanBabra/378884cad3fea3c1e77963e3bce7d540 to your computer and use it in GitHub Desktop.
public class ShoppingContext : DbContext
{
public DbSet<Product> Product { get; set; }
public DbSet<ShoppingCart> ShoppingCart { get; set; }
public DbSet<Account> Account { get; set; }
public DbSet<CartItem> CartItem { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(@"Server=.\SQLEXPRESS;Database=Shopping;Trusted_Connection=True;");
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment