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
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2017/12/aspnet-allowing-anonymous-requests-on.html | |
// ********************************************** | |
[HttpPost] | |
[ValidateAntiForgeryToken] | |
[RequirePermission("Update")] | |
public async Task<JsonResult> SomeOperation(string id) | |
{ | |
// your code here |
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
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/02/migrating-nservicebus-backends-to-azure.html | |
// ********************************************** | |
// Related docs: | |
// * NSB WebJobs: https://docs.particular.net/samples/azure/webjob-host/ | |
// * Azure WebJobs: https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-get-started | |
public class Program | |
{ |
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
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/02/migrating-nservicebus-backends-to-azure.html | |
// ********************************************** | |
// Related docs: | |
// * NSB WebJobs: https://docs.particular.net/samples/azure/webjob-host/ | |
// * Azure WebJobs: https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-get-started | |
public class Program | |
{ |
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
<!-- | |
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/02/migrating-nservicebus-backends-to-azure.html | |
// ********************************************** | |
--> | |
<?xml version="1.0"?> | |
<package> | |
<metadata> |
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
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2018/08/masstransit-real-alternative-to.html | |
// ********************************************** | |
using System.Threading; | |
using System.Threading.Tasks; | |
using MassTransit; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; |
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
// ********************************************** | |
// Fore more information, visit: | |
// Blog: https://blog.hildenco.com/2018/08/masstransit-real-alternative-to.html | |
// Source: https://github.com/MassTransit/Sample-Direct | |
// ********************************************** | |
using System; | |
using System.Diagnostics; | |
using System.Threading.Tasks; | |
using Contracts; | |
using MassTransit; |
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
// ********************************************** | |
// Fore more information, visit: | |
// Blog: https://blog.hildenco.com/2018/08/masstransit-real-alternative-to.html | |
// Source: https://github.com/MassTransit/Sample-Direct | |
// ********************************************** | |
using System; | |
using System.Threading.Tasks; | |
using Contracts; | |
using MassTransit; |
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
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/02/migrating-nservicebus-backends-to-azure.html | |
// ********************************************** | |
// Related docs: | |
// - NSB WebJobs: https://docs.particular.net/samples/azure/webjob-host/ | |
// - Azure WebJobs: https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-get-started | |
public class Program | |
{ |
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
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/03/adding-application-insights-telemetry.html | |
// ********************************************** | |
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] | |
public IActionResult Error() | |
{ | |
// IExceptionHandlerPathFeature requires Microsoft.AspNetCore.Diagnostics | |
// run: dotnet add package Microsoft.AspNetCore.Diagnostics --version 2.2.0 | |
var error = HttpContext.Features.Get<IExceptionHandlerFeature>(); |
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
// ********************************************** | |
// Fore more information, visit: | |
// https://blog.hildenco.com/2020/03/adding-application-insights-telemetry.html | |
// ********************************************** | |
public IActionResult Privacy() | |
{ | |
_telemetry.TrackEvent($"Privacy requested @ {DateTime.UtcNow} UTC"); | |
return View(); | |
} |