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 class CustomerIntegrationModel | |
{ | |
public string CustomerId { get; set; } | |
public string Name { get; set; } | |
} | |
public class CustomerRequestModel | |
{ | |
public string CustomerId { get; set; } | |
public string Name { get; set; } |
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
try | |
{ | |
// notify customer about rejected card purchase | |
} | |
catch(Exception e) | |
{ | |
_logger.Fatal(e, "Failed to notify customer about rejected card purchase. Please ask Customer Care Center to call the customer and tell him/her about this to avoid degradation of reputation"); | |
} |
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
try | |
{ | |
// network call | |
} | |
catch(Exception e) | |
{ | |
_logger.Warning(e, "Network call failed"); | |
} |
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
try | |
{ | |
// network call | |
} | |
catch(Exception e) | |
{ | |
_logger.Error(e, "Network call failed"); | |
} |
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 class Function | |
{ | |
private static ServiceProvider ServiceProvider { get; set; } | |
/// <summary> | |
/// The parameterless constructor is what Lambda uses to construct your instance the first time. | |
/// It will only ever be called once for the lifetime of the container that it's running on. | |
/// We want to build our ServiceProvider once, and then use the same provider in all subsequent | |
/// Lambda invocations. This makes things like using local MemoryCache techniques viable (Just | |
/// remember that you can never count on a locally cached item to be there!) |
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
Pacific/Niue | |
Pacific/Midway | |
Pacific/Pago_Pago | |
America/Adak | |
Pacific/Rarotonga | |
Pacific/Tahiti | |
Pacific/Honolulu | |
Pacific/Marquesas | |
America/Metlakatla | |
America/Sitka |
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 void ConfigureServices(IServiceCollection services) | |
{ | |
// .... | |
services.AddApplicationInsightsTelemetry(Configuration); | |
services.AddApplicationInsightsTelemetryProcessor<IgnoreRequestPathsTelemetryProcessor>(); | |
// .... | |
} |
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 class IgnoreRequestPathsTelemetryProcessor : ITelemetryProcessor | |
{ | |
private readonly ITelemetryProcessor _next; | |
public IgnoreRequestPathsTelemetryProcessor(ITelemetryProcessor next) | |
{ | |
_next = next; | |
} | |
public void Process(ITelemetry item) |
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
# Builds all nugets for easier local development | |
mac: | |
dotnet pack src/Your.Project.Here.csproj -o ~/localfeed | |
windows: | |
dotnet pack src/Your.Project.Here.csproj -o c:\localfeed |
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 class AnotherWorker : BackgroundService | |
{ | |
private readonly IHostApplicationLifetime _hostApplicationLifetime; | |
public AnotherWorker(IHostApplicationLifetime hostApplicationLifetime) | |
{ | |
_hostApplicationLifetime = hostApplicationLifetime; | |
} | |
public override Task StartAsync(CancellationToken cancellationToken) |