public static void Main(string[] args) { //var projectPath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, @"..\Migrations.DataContext")); string[] possibleProjectPaths = { @"D:\B\BrandlessOpen\Code\dnx\Brandless.EntityFrameworkCore.Migrations\src\Migrations.DataContext", @"D:\Code\Git\Brandless\BrandlessOpen\Code\dnx\Brandless.EntityFrameworkCore.Migrations\src\Migrations.DataContext" }; var projectPath = possibleProjectPaths.First(Directory.Exists); Console.WriteLine("Running in " + projectPath.Yellow()); var codeFirstMigrations = new CodeFirstMigrations <AppDbContext>(projectPath); codeFirstMigrations.Add("Init"); }
public static void Main(string[] args) { string[] possibleProjectPaths = { @"D:\Code\Git\Forks\OData-WebApi\vNext\samples\ODataSample", @"D:\B\Forks\OData-WebApi\vNext\samples\ODataSample" }; var projectPath = possibleProjectPaths.First(Directory.Exists); var mig = new CodeFirstMigrations<ApplicationDbContext>(projectPath); Console.WriteLine("Please enter the name of this migration:"); var name = Console.ReadLine(); name = string.IsNullOrWhiteSpace(name) ? "" : name; if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("No name provided for the migration"); } mig.Add(name); }
public static void Main(string[] args) { string[] possibleProjectPaths = { @"D:\Code\Git\Forks\OData-WebApi\vNext\samples\ODataSample", @"D:\B\Forks\OData-WebApi\vNext\samples\ODataSample" }; var projectPath = possibleProjectPaths.First(Directory.Exists); var mig = new CodeFirstMigrations <ApplicationDbContext>(projectPath); Console.WriteLine("Please enter the name of this migration:"); var name = Console.ReadLine(); name = string.IsNullOrWhiteSpace(name) ? "" : name; if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("No name provided for the migration"); } mig.Add(name); }