示例#1
0
 // This method gets called by the runtime. Use this method to add
 // services to the container.
 // For more information on how to configure your application, visit
 // http://go.microsoft.com/fwlink/?LinkID=398940
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddSingleton(sp => StartupExtensions.GetPostgreSqlConnectionString());
     services.AddMvc(options =>
     {
         options.Filters.Add(typeof(DbExceptionFilterAttribute));
     });
 }
 public static void Main(string[] args)
 {
     // Create Database table if it does not exist.
     StartupExtensions.InitializeDatabase();
     BuildWebHost(args).Build().Run();
 }