0

Is it possible to change entity framework code-first class at runtime by reflection? Or even generate it?

Or what happens to database if we change those classes at runtime?

Thanks

6
  • Are you talking about adding and removing properties at runtime? Commented Mar 15, 2017 at 13:11
  • 1
    The database migration is done once when you start the application/access the DbContext the first time. Commented Mar 15, 2017 at 13:12
  • Yes,I want to know if changing properties is possible. Commented Mar 15, 2017 at 13:16
  • But i need to remove a class at runtime from DbContext class or add into it. Commented Mar 15, 2017 at 13:17
  • 2
    No, not at runtime. If you want to change an EF model, you need to do it before you compile. Commented Mar 15, 2017 at 13:26

0

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.