2

I have my app and db on hosting. I can not delete database by myself, so I want to if model changes recreate only tables and database will not touch.

I see that somebody use sql command to delete table and create it new, but it is possible to just disable database delete and Code first script just delete table and create new ?

1 Answer 1

1

You'd probably have to create a custom DbInitializer, which knows how to drop any existing objects in your database. Instead, have you considered moving the EF Code First Migrations, now available in EF 4.3? See here for a walkthough.

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

1 Comment

Woow, I was waiting for this feature from beginning of EF CF ;) Great!

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.