Last active
May 25, 2019 19:36
-
-
Save ParmanBabra/378884cad3fea3c1e77963e3bce7d540 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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