Ketan Mokariya

Ketan Mokariya

  • NA
  • 949
  • 280.5k

Call dbfirst migration script through in Entity framework.

Jan 18 2018 4:39 AM
Hi,
 
I have developed application based on Asp.net MVC 5 .where I am using entity framework db first approach for my all database creation.
 
I am building functionality that whenever I publish my application in production environment with empty db it should create db schema when application run for first time.
 
My current issue is I have my db first migration script with all schemas require in migration folder. If I want to run migration I have to fire command something like 'Update-Database'. But my motive is to run this command or achieve db schema creation through my code on app start event.
 
Is there any way I can achieve this functionality? Require your help and suggestion.
 
Thanks,

Answers (1)