0

we don't use migration because our existing databases are with clients devices and want to create additional tables to their databases after updates for feature extensions...

there was an option like Context.DbEntity.Create(); in ef6 but not getting in ef core to do so...

I used the below but it also not creating tables which doesn't exist...

try{

  var databaseCreator = (Database.GetService<IDatabaseCreator>() as RelationalDatabaseCreator);

            databaseCreator.CreateTables();

        }

        catch (Exception ex)

        {

            System.Console.WriteLine(ex.Message);

        }

Regards- Sanjeeb

Malakiya sanjay
  • 208
  • 2
  • 12
  • Does this answer your question? https://stackoverflow.com/questions/38238043/how-and-where-to-call-database-ensurecreated-and-database-migrate – Jan Feb 13 '20 at 09:06
  • 1
    I have tried the link but this approach only works on first launch. If I want to add other table afterward, it's not working... the same can be done by ado.net but it's so long and lengthy to write scripts for every table... – user3289243 Feb 13 '20 at 09:50
  • is no one here to help me ? – user3289243 Feb 14 '20 at 14:32

0 Answers0