2

Through the entity framework, I would like it to recreate my tables, and not my databases. The reason for this is that I have no permission to drop an entire database, whereas I do have permission to create and drop tables.

1 Answer 1

2

I don't think there is such an initializer for EF 4.1 from MS.

This comes closest to your needs:

class BlogContext : DbContext
{

    public BlogContext()
    {
        System.Data.Entity.Database.SetInitializer(new CreateDatabaseIfNotExists<BlogContext>());
    }

}

To implement it yourself: http://dotnet.dzone.com/news/creating-code-first-database?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+zones%2Fcss+%28CSS+Zone%29

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.