This file contains hidden or 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
################################################################## | |
## POST multiple files with multipart/form-data with PowerShell v5 | |
################################################################## | |
## POST Uri | |
$uri = "https://localhost/" | |
## Consts | |
$successFiles = './success' | |
$tempFile = './tempfile' |
This file contains hidden or 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
// SampleDiLogicA.cs | |
public async Task<int> SampleMethodAsync() | |
{ | |
int i; | |
using (var txScope = await _dbManager.BeginTranRequiredAsync()) | |
{ | |
const string identifier = @"X000A"; | |
// Dapper |
This file contains hidden or 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
// Startup.cs | |
services.AddScoped(_ => | |
new OneWorldDbClientManager<YourEfDbContext>( | |
Configuration.GetConnectionString("DefaultConnection"), | |
(connection, transaction) => | |
{ | |
var dbContext = new YourEfDbContext( | |
new DbContextOptionsBuilder<YourEfDbContext>() | |
.UseSqlServer((DbConnection)connection) | |
.Options); |
This file contains hidden or 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
namespace EFCoreEnableSystemVersionedTemporalTables | |
{ | |
public static class EnableSystemVersionedTemporalTables | |
{ | |
private static readonly (string SysStartTimeString, string SysEndTimeString) TemporalTableAdditionalFileds = (SysStartTimeString: "SysStartTime", SysEndTimeString: "SysEndTime"); | |
public static void AddAsSystemVersionedTemporalTable(this MigrationBuilder migrationBuilder, string tableName, string temporalScheme = null, string temporalTableSuffix = @"History") | |
{ | |
var temporalTableName = $"{tableName}{temporalTableSuffix}"; | |
var schemaName = temporalScheme ?? "dbo"; |
This file contains hidden or 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
using System; | |
using System.Diagnostics; | |
using Microsoft.Azure.WebJobs.Host; | |
namespace Samples.SampleBizLogic.Tests | |
{ | |
public class UnitTestTraceWriter : TraceWriter | |
{ | |
private readonly Action<TraceEvent> _traceAction; |
This file contains hidden or 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 SampleFunction2WithOptions | |
{ | |
[FunctionName("SampleFunction2WithOptions")] | |
public static IActionResult Run( | |
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequest req, | |
TraceWriter log, | |
[CbOptions(sectionKey: "SampleBizLogic:MyBizOptions", reloadOnChange: true)]MyBizOptions options ) | |
{ | |
//... |
This file contains hidden or 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 SampleFunction2WithOptions | |
{ | |
[FunctionName("SampleFunction2WithOptions")] | |
public static IActionResult Run( | |
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequest req, | |
TraceWriter log ) | |
{ | |
//... |