Using SQL Query in Migration file
From Logic Wiki
Revision as of 15:08, 5 April 2017 by AliIybar (Talk | contribs) (Created page with "Category:Core Category:MVC Category:CSharp in migration UP part migrationBuilder.Sql("INSERT INTO Makes (Name) VALUES ('Test')"); migrationBuilder.Sql("INSERT...")
in migration UP part
migrationBuilder.Sql("INSERT INTO Makes (Name) VALUES ('Test')");
migrationBuilder.Sql("INSERT INTO Models (Name, MakeID) VALUES ('Model 1', (SELECT Id FROM Makes WHERE Name = 'Test'))");