Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux
Although I highly recommend using a snap
sudo snap install postman
tar -xzf Postman-linux-x64-5.3.2.tar.gz
root = true | |
# C# files | |
[*.cs] | |
#### Core EditorConfig Options #### | |
# Indentation and spacing | |
indent_size = 4 | |
indent_style = space |
//program.cs | |
var app = builder.Build(); | |
var scope = app.Services.CreateScope(); | |
await DataHelper.ManageDataAsync(scope.ServiceProvider); |
public static class ConnectionHelper | |
{ | |
public static string GetConnectionString(IConfiguration configuration) | |
{ | |
var connectionString = configuration.GetConnectionString("DefaultConnection"); | |
var databaseUrl = Environment.GetEnvironmentVariable("DATABASE_URL"); | |
return string.IsNullOrEmpty(databaseUrl) ? connectionString : BuildConnectionString(databaseUrl); | |
} | |
//build the connection string from the environment. i.e. Heroku |
public static class DataHelper | |
{ | |
public static async Task ManageDataAsync(IServiceProvider svcProvider) | |
{ | |
//Service: An instance of db context | |
var dbContextSvc = svcProvider.GetRequiredService<ApplicationDbContext>(); | |
//Migration: This is the programmatic equivalent to Update-Database | |
await dbContextSvc.Database.MigrateAsync(); |
Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux
Although I highly recommend using a snap
sudo snap install postman
tar -xzf Postman-linux-x64-5.3.2.tar.gz