If you don’t want to use migrations but in the same time you want EF to create database for you, you just need to set correct database initializer:
Database.SetInitializer<YourContextType>(new CreateDatabaseIfNotExists<YourContentType>());
More Related Contents:
- Can you create sql views / stored procedure using Entity Framework 4.1 Code first approach
- Oracle.ManagedDataAccess.EntityFramework – ORA-01918: user ‘dbo’ does not exist
- CREATE DATABASE permission denied in database ‘master’ (EF code-first)
- Entity Framework – Is there a way to automatically eager-load child entities without Include()?
- Best way to incrementally seed data in Entity Framework 4.3
- Entity framework 4.3 run migrations at application start
- Entity Framework: One Database, Multiple DbContexts. Is this a bad idea? [closed]
- Unique Constraint in Entity Framework Code First
- Validation failed for one or more entities while saving changes to SQL Server Database using Entity Framework
- ASP.NET MVC3 and Entity Framework Code first architecture
- Entity Framework DateTime and UTC
- Does Entity Framework Code First support stored procedures?
- Entity Framework Code First – No Detach() method on DbContext
- Understanding ForeignKey attribute in entity framework code first
- Mapping Database Views to EF 5.0 Code First w/Migrations
- Entity Framework CTP 4 – Code First Custom Database Initializer
- EF migration for changing data type of columns
- How can I disable code first migrations
- Linq when using GroupBy, Include is not working
- Self-referencing many-to-many recursive relationship code first Entity Framework
- Entity Framework Database.SetInitializer simply not working
- Entity Framework Code First Date field creation
- Entity Framework initialization is SLOW — what can I do to bootstrap it faster?
- Nullable property to entity field, Entity Framework through Code First
- Entity Framework Code First Using Guid as Identity with another Identity Column
- AutomaticMigrationsEnabled false or true?
- Converting a LEFT OUTER JOIN to Entity Framework
- Change foreign key constraint naming convention
- Entity Framework Code First Many to Many Setup For Existing Tables
- LINQ to Entities does not recognize the method ‘System.String ToString()’ method in MVC 4