View AwaitExtensions2.cs
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 System; | |
using System.Diagnostics; | |
using System.Runtime.CompilerServices; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace MyApp | |
{ | |
/// <summary> | |
/// Replaces Microsoft.Bcl.Async extensions and provides more detailed stack traces |
View InstallNetFx461.ps1
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
#Requires -Version 3.0 | |
<# | |
.DESCRIPTION | |
Install .Net Framework 4.6.1 | |
#> | |
[CmdletBinding()] | |
Param( |
View Startup.cs
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 System.Linq; | |
using System.Reflection; | |
using AspNetNoDnx.Runtime; | |
using Microsoft.AspNet.Builder; | |
using Microsoft.AspNet.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.PlatformAbstractions; |
View AsyncStackTrace.cs
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
// see the full featured library at | |
// https://github.com/aelij/asyncstacktrace |
View -Usage.cs
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
class MyService : StatefulService | |
{ | |
private Task<IReliableDictionary<int, string>> AccountNames => StateManager.GetOrAddAsync<IReliableDictionary<int, string>>("AccountNames"); | |
private Task<IReliableDictionary<int, string>> AccountData => StateManager.GetOrAddAsync<IReliableDictionary<int, string>>("AccountData"); | |
public async Task<List<Account>> SearchAccountsByNameAsync(string name) | |
{ | |
using (var txn = StateManager.CreateTransaction()) | |
{ | |
var accountNames = await AccountNames; |
View cs7-match.csx
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
abstract class Animal { } | |
class Dog : Animal | |
{ | |
public string Bark() => "Woof"; | |
} | |
class Cat : Animal | |
{ | |
public string Meow() => "Meow"; |
View ThemeManager.cs
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 System; | |
using System.Reflection; | |
using System.Windows; | |
public static class ThemeManager | |
{ | |
#region Fields | |
private const BindingFlags DefaultStaticFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static; | |
private const BindingFlags DefaultInstanceFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; |
View AsyncEnumerableGenerator.cs
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 System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.CompilerServices; | |
using System.Security; | |
using System.Threading; | |
using System.Threading.Tasks; |
View Download-ServiceFabricImageStoreContent.ps1
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
# Examples: | |
# | |
# List image store content: | |
# $connectionString = Get-ServiceFabricImageStoreConnectionString | |
# Get-ServiceFabricApplicationType | % { Get-ServiceFabricImageStoreContent -Application -ApplicationTypeName $_.ApplicationTypeName -ApplicationTypeVersion $_.ApplicationTypeVersion -ImageStoreConnectionString $connectionString } | |
# > StoreRelativePath : Store\Application1Type\Stateless1Pkg.Code.1.0.0 | |
# > Type : Folder [5 files] | |
# > ServiceManifestName : Stateless1Pkg | |
# > ServiceManifestVersion : 1.0.0 | |
# > ApplicationVersion : 1.0.0 |
View Create-ServiceFabricApplicationPackageSkeleton.ps1
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
function Create-ServiceFabricApplicationPackageSkeleton | |
{ | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] | |
[string] $ApplicationTypeName, | |
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] | |
[string] $ApplicationTypeVersion, |
OlderNewer