示例#1
0
        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");
        }
示例#2
0
		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);
		}
示例#3
0
文件: Program.cs 项目: ldcdev/WebApi
        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);
        }