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/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 | |
// ********************************************** | |
// 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/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
###################################################################### | |
# list-dotnet-frameworks.ps1 | List installed .NET Framework versions | |
###################################################################### | |
# Source: https://blog.hildenco.com/2020/01/determining-installed-net-framework.html | |
# It may be required to run Powershell with the following command line: | |
# Powershell.exe -executionpolicy remotesigned -File | |
function Get-Installed-Framework-Versions() { |
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
################################# | |
# Source: https://blog.hildenco.com/2019/08/how-i-fell-in-love-with-i3.html | |
################################# | |
# start a terminal | |
bindsym $mod+Return exec gnome-terminal | |
# kill focused window | |
bindsym $mod+x kill |
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
using Raven.Client.Documents; | |
using Raven.Client.Documents.Operations.Backups; | |
using Raven.Client.Documents.Operations.ETL.SQL; | |
using Raven.Client.Documents.Smuggler; | |
using Raven.Client.ServerWide; | |
using Raven.Client.ServerWide.Operations; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Security.Cryptography.X509Certificates; |
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
// Step 3 - Resolve the service from the background task | |
// Source: https://blog.hildenco.com/2018/12/accessing-entity-framework-context-on.html | |
private async Task BgTask(string id, IServiceScopeFactory serviceScopeFactory) | |
{ | |
await Task.Delay(30000); | |
using (var scope = serviceScopeFactory.CreateScope()) | |
{ | |
var dbContext = scope.ServiceProvider.GetService<ApplicationDbContext>(); |
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
// Step 2 - Pass it to your background thread | |
// Source: https://blog.hildenco.com/2018/12/accessing-entity-framework-context-on.html | |
public async Task<IActionResult> TestAsyncCall(string id) | |
{ | |
Task.Run(() => BgTask(id, serviceScopeFactory)); | |
return Ok("Thanks, your code will be executed!"); | |
} |