2021-04-02 17:28:07 +05:00
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
2021-12-02 11:11:14 +05:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
2021-04-02 17:28:07 +05:00
|
|
|
|
using Microsoft.Extensions.Hosting;
|
2021-12-02 11:11:14 +05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
2021-04-02 17:28:07 +05:00
|
|
|
|
|
|
|
|
|
namespace AsbCloudWebApi
|
|
|
|
|
{
|
|
|
|
|
public class Program
|
|
|
|
|
{
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
{
|
2021-11-22 14:04:05 +05:00
|
|
|
|
//new TraceListenerView(); // to trace mysterious errors
|
2021-12-02 11:24:54 +05:00
|
|
|
|
if(args?.Length > 0 )
|
2021-12-02 11:11:14 +05:00
|
|
|
|
{
|
|
|
|
|
if (args.Contains("db_init")) {
|
|
|
|
|
var connectionStringName = "DefaultConnection";
|
|
|
|
|
|
|
|
|
|
IConfigurationRoot configuration = new ConfigurationBuilder()
|
|
|
|
|
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
|
|
|
|
|
.AddJsonFile("appsettings.json")
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
AsbCloudInfrastructure.DependencyInjection.MakeContext(configuration.GetConnectionString(connectionStringName));
|
|
|
|
|
Console.WriteLine("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
WriteHelp();
|
2021-12-02 11:24:54 +05:00
|
|
|
|
return;
|
2021-12-02 11:11:14 +05:00
|
|
|
|
}
|
|
|
|
|
|
2021-04-02 17:28:07 +05:00
|
|
|
|
CreateHostBuilder(args).Build().Run();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
|
|
|
Host.CreateDefaultBuilder(args)
|
|
|
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|
|
|
|
{
|
|
|
|
|
webBuilder.UseStartup<Startup>();
|
|
|
|
|
});
|
2021-12-02 11:11:14 +05:00
|
|
|
|
|
|
|
|
|
private static void WriteHelp()
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("<22><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.");
|
|
|
|
|
Console.WriteLine("<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
Console.WriteLine("db_init - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD>.");
|
|
|
|
|
Console.WriteLine("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \"DefaultConnection\"");
|
|
|
|
|
Console.WriteLine("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>, <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>");
|
|
|
|
|
Console.WriteLine("<22> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>.");
|
|
|
|
|
Console.WriteLine("<22><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> public");
|
|
|
|
|
Console.WriteLine("");
|
|
|
|
|
}
|
2021-04-02 17:28:07 +05:00
|
|
|
|
}
|
|
|
|
|
}
|