public override async Task <bool> Execute(Input input) { Console2.Line("Seeding data"); _db.Categories.AddIfNotExists( m => m.Name == "Arts", new Category { Name = "Arts" }); _db.Categories.AddIfNotExists( m => m.Name == "Food", new Category { Name = "Food" }); _db.Categories.AddIfNotExists( m => m.Name == "Music", new Category { Name = "Music" }); await _db.SaveChangesAsync(); Console2.GreenLine("Done!"); return(true); }
public static void New(this Maker m, string name) { var newSolutionDir = A.Path(m.Solution.RootDir, name); ThrowIfNewDirectoryExist(newSolutionDir); Console.WriteLine(); // root m.Directory(); Console.WriteLine(); var map = Maker.ReadEmbedded("_New.yml").FromYml <Dictionary <string, string> >(); foreach (var(key, stub) in map) { // FIXME: Use same tokens replacement as m.Template var destination = key .Replace("Corpo.Skeleton", m.Solution.Name) .Replace("Skeleton", m.Solution.ShortName) .Replace('\\', Path.DirectorySeparatorChar); m.Template(stub, destination); } m.Template("appSettings-example.yml", A.Path("src") / name / "appSettings.Development.yml"); m.Template("appSettings-example.yml", A.Path("src") / name / "appSettings.Test.yml"); Console2.BreakLine(); Console2.Line($"New solution created at:"); Console2.BreakLine(); Console2.GreenLine($"\t{m.Solution.RootDir}"); Console2.BreakLine(); Console2.GreenLine("Good luck!"); }
public static void New(this Maker m, string name) { var newSolutionDir = A.Path(m.Solution.RootDir, name); ThrowIfNewDirectoryExist(newSolutionDir); Console.WriteLine(); // root m.Directory(); Console.WriteLine(); var map = Maker.ReadEmbedded("_New.yml").FromYml <Dictionary <string, string> >(); foreach (var(key, stub) in map) { var destination = key .Replace("Skeleton", name) .Replace('\\', Path.DirectorySeparatorChar); m.Template(stub, destination); } Console2.BreakLine(); Console2.Line($"New solution created at:"); Console2.BreakLine(); Console2.GreenLine($"\t{m.Solution.RootDir}"); Console2.BreakLine(); Console2.GreenLine("Good luck!"); }
public override async Task Execute() { Console2.Line("Creating database"); await _databaseCreator.Create(); Console2.GreenLine("Database created"); }
public override void Execute() { Console2.YellowLine("Host:"); Console2.Line(_hostEnvironment.ToYml()); Console2.YellowLine("Database:"); Console2.Line(_dbOptions.ToYml()); }
public Task Execute() { Console2.Line("Creating database"); _databaseCreator.Create().Wait(); Console2.GreenLine("Database created"); return(Task.CompletedTask); }
public override bool Execute(Input input) { Console2.Yellow("App version: "); Console2.Line($"{Assembly.GetEntryAssembly().GetName().Name} {Assembly.GetEntryAssembly().GetName().Version}"); Console2.Yellow("Miru version: "); Console2.Line(typeof(App).Assembly.GetName().Version?.ToString()); Console.WriteLine(); Console2.YellowLine("Host:"); Console2.Line(_hostEnvironment.ToYml()); Console2.YellowLine("All Configurations: "); Console.WriteLine(GetDebugView(_configuration as IConfigurationRoot)); return(true); }