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
https://gist.github.com/pcibraro/b31f46b5ba2df74a6f868251230df977 |
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
<http:request-config name="HTTP_Azure_Bridge" host="#[flowVars.settings[0].azure_bridge_host]" port="#[flowVars.settings[0].azure_bridge_port]" doc:name="HTTP Request Configuration" basePath="/SUBSCRIPTIONID" connectionIdleTimeout="60000" responseTimeout="60000"> | |
<oauth2:client-credentials-grant-type clientId="${clientid}" clientSecret="${secret}"> | |
<oauth2:token-request tokenUrl="${token_url}"/> | |
<tls:context> | |
<tls:trust-store insecure="true"/> | |
</tls:context> | |
</oauth2:client-credentials-grant-type> | |
<http:raml-api-configuration location="AzureManagementApi.raml"/> | |
</http:request-config> |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (Isolated<Work> isolated = new Isolated<Work>()) | |
{ | |
isolated.Value.CallEdge(); | |
} | |
} | |
} |
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 HawkAuthenticationHandler : AuthenticationHandler<HawkAuthenticationOptions> | |
{ | |
private readonly ILogger logger; | |
public HawkAuthenticationHandler(ILogger logger) | |
{ | |
this.logger = logger; | |
} | |
protected override Task<AuthenticationTicket> AuthenticateCore() |
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 LogginHandler : DelegatingHandler | |
{ | |
public LogginHandler(HttpMessageHandler inner) | |
: base(inner) | |
{ | |
} | |
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) | |
{ | |
using (var fs = new FileStream("c:\\temp\\log.txt", FileMode.Create, FileAccess.Write)) |
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
RoutePrefix("user")] | |
public class UserController : ApiController | |
{ | |
public UserController() | |
{ | |
} | |
[GET("", RouteName="GetUser")] | |
public UserProfile Get() |
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 async Task<IEnumerable<SearchResult>> Get() | |
{ | |
var providers = this.locator.GetAllProviders(resource); | |
var allResults = new List<SearchResult>(); | |
foreach (var provider in providers) | |
{ | |
var results = await provider.Search("foo"); |
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 DisposableEnumerable<T> : IEnumerable<T> | |
{ | |
IEnumerable<T> source; | |
public DisposableEnumerable(IEnumerable<T> source) | |
{ | |
this.source = source; | |
} | |
public IEnumerator<T> GetEnumerator() |