This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Server=localhost,1600;Initial Catalog=$DB_NAME;Persist Security Info=False;User ID=sa;Password=yourStrong(!)Password;MultipleActiveResultSets=True;TrustServerCertificate=True;Connection Timeout=30; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
db: | |
environment: | |
ACCEPT_EULA: "Y" | |
SA_PASSWORD: "yourStrong(!)Password" | |
# mssql server image isn't available for arm64 architecture, so we use azure-sql instead | |
image: mcr.microsoft.com/azure-sql-edge:latest | |
# If you really want to use MS SQL Server, uncomment the following line | |
#image: mcr.microsoft.com/mssql/server | |
ports: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ConfigurationExtensions | |
{ | |
public static string GetConnectionStringOrThrow(this IConfiguration configuration, string name) | |
{ | |
var connectionString = configuration.GetConnectionString(name); | |
if (string.IsNullOrWhiteSpace(connectionString)) | |
{ | |
throw new InvalidOperationException($"Connection string '{name}' not found."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// NOTE: If any of your connection strings real passwords, you should delete them and put them in the user secrets file instead. | |
"ConnectionStrings": { | |
"DefaultConnection": "Server=localhost,1500;Initial Catalog=CleanArchitecture;Persist Security Info=False;User ID=sa;Password=yourStrong(!)Password;MultipleActiveResultSets=True;TrustServerCertificate=True;Connection Timeout=30;" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// k6 run ./script.js | |
import http from 'k6/http'; | |
import { sleep, check } from 'k6'; | |
import { Rate } from 'k6/metrics'; | |
export const errorRate = new Rate('errors'); | |
export let options = { | |
insecureSkipTLSVerify: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Originally Created by William Liebenberg | |
Param( | |
[switch]$skipDeploy = $false, | |
[string]$apiDbConnectionString = "Server=.,2100;Database=MoMo;User Id=sa;Password=Password!##3;MultipleActiveResultSets=true;TrustServerCertificate=True;" | |
) | |
$upScriptPath = $Script:MyInvocation.MyCommand.Path | Split-Path | |
$srcPath = Join-Path -Path $upScriptPath -ChildPath "src" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MigrationExtensions | |
{ | |
public static void ApplyMigrations(this IApplicationBuilder app) | |
{ | |
using IServiceScope scope = app.ApplicationServices.CreateScope(); | |
using ApplicationDbContext dbContext = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>(); | |
dbContext.Database.Migrate(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class StringLengthGuard | |
{ | |
public static string StringLength(this IGuardClause guardClause, | |
string input, | |
int maxLength, | |
[CallerArgumentExpression("input")] string? parameterName = null) | |
{ | |
if (input?.Length > maxLength) | |
throw new ArgumentException($"Cannot exceed string length of {maxLength}", parameterName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param | |
( | |
[Parameter(Position = 0, Mandatory)] | |
[ValidateNotNullOrEmpty()] | |
[string]$WebApp, | |
[Parameter(Position = 1, Mandatory)] | |
[ValidateNotNullOrEmpty()] | |
[string]$ResourceGroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ContentReferenceExt | |
{ | |
public static T ToContentType<T>(this ContentReference contentReference) where T : ContentData | |
{ | |
if (contentReference.IsEmpty()) | |
return null; | |
var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>(); | |
return contentLoader.TryGet(contentReference, out T content) ? content : null; | |
} |
NewerOlder