Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public DbSet<Category> Categories { get; set; }
- public ApplicationDbContext(): base("DefaultConnection", throwIfV1Schema: false)
- {
- }
- public static ApplicationDbContext Create()
- {
- return new ApplicationDbContext();
- }
- protected override void OnModelCreating(DbModelBuilder modelBuilder)
- {
- //Database.SetInitializer<ApplicationDbContext>(null);
- base.OnModelCreating(modelBuilder);
- }
- var test = new Category { CategoryName = "test" }; --- This cant find Categories
- context.Category.Add(test); ---This cant find Category
- context.SaveChanges();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement