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
// assuming we have an IoC container. Autofac example | |
var builder = new ContainerBuilder(); | |
// assuming your global.asax.cs defines WebApiApplication : HttpApplication | |
builder.RegisterApiControllers(typeof(WebApiApplication).Assembly); | |
var container = builder.Build(); | |
// getting the controller | |
var target = container.Resolve<MyController>(); | |
var request = new HttpRequestMessage(); | |
request.Properties[HttpPropertyKeys.HttpConfigurationKey] = new HttpConfiguration(); |
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
<system.webServer> | |
<modules runAllManagedModulesForAllRequests="false"> | |
<remove name="WebDAVModule" /> | |
</modules> | |
<handlers> | |
<remove name="WebDAV"/> | |
<remove name="OPTIONSVerbHandler"/> | |
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> | |
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> | |
<remove name="ExtensionlessUrlHandler-Integrated-4.0" /> |
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
SELECT name | |
FROM sys.objects | |
WHERE type = 'U' | |
AND object_id NOT IN | |
(SELECT object_id FROM sys.indexes WHERE index_id = 1) |
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
#!/bin/bash | |
PREFIX=$@ | |
if [ -z $PREFIX ]; then | |
PREFIX="/usr/local" | |
fi | |
# Ensure you have write permissions to PREFIX | |
sudo mkdir -p $PREFIX | |
sudo chown -R `whoami` $PREFIX |
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.Threading.Tasks; | |
public class Program | |
{ | |
public static async Task Main() | |
{ | |
var t1 = MethodAsync(); | |
// await Task.Delay(/*0*/1).ConfigureAwait(false); | |
var t2 = MethodAsync(); |