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
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", | |
"profiles": |
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; | |
namespace System.Data.SqlClient { | |
public class SqlHelper { | |
readonly string connectionString; | |
public SqlHelper(string connectionString) { this.connectionString = connectionString; } | |
public string StringCommand (string commandString, Action<SqlParameterCollection> bindingCommand) { | |
using (var connection = new SqlConnection(connectionString)) { |
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; | |
namespace DecoratorKata | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var service = new RoundBracketsDecorator( | |
new SquareBracketsDecorator( |
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
namespace System | |
{ | |
public static class StringExtensions | |
{ | |
public static bool Contains(this string source, string toCheck, StringComparison comp) | |
{ | |
return source?.IndexOf(toCheck, comp) >= 0; | |
} | |
public static bool IsNullOrEmpty(this String @string) |
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
<ItemGroup> | |
<Reference Include="System.ComponentModel.DataAnnotations" Condition="'$(TargetFramework)' == 'net4.5'" /> | |
</ItemGroup> |
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
// Defers the use of runtime data after object graph construction | |
// see: https://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=99 | |
public sealed class AspNetPrincipalProxy : IPrincipal | |
{ | |
public IIdentity Identity => User.Identity; | |
public bool IsInRole(string role) => User.IsInRole(role); | |
private IPrincipal User => HttpContext.Current.User; | |
} |
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
#addin "nuget:?package=Cake.SqlServer" | |
var target = Argument("target", "Default"); | |
var configuration = Argument("configuration", "Release"); | |
Task("Testing-Database") | |
.Does(() => | |
{ | |
LocalDbCreateInstance("v12.0", LocalDbVersion.V12); |
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.Collections.Generic; | |
using System.Linq; | |
using System.Management.Instrumentation; | |
using Autofac; | |
using Autofac.Builder; | |
using Autofac.Core; | |
using Autofac.Features.ResolveAnything; | |
using Moq; | |
using MyProject.Domain.Services.Configuration; |
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 partial class Startup | |
{ | |
private static string clientId = CloudConfigurationManager.GetSetting("ida:ClientId"); | |
private static string appKey = CloudConfigurationManager.GetSetting("ida:ClientSecret"); | |
private static string aadInstance = CloudConfigurationManager.GetSetting("ida:AADInstance"); | |
private static string tenantId = CloudConfigurationManager.GetSetting("ida:TenantId"); | |
private static string postLogoutRedirectUri = CloudConfigurationManager.GetSetting("ida:PostLogoutRedirectUri"); | |
public static readonly string Authority = aadInstance + tenantId; |
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
[TestCase("Projects Topside", "Projects Systems")] | |
[TestCase("Topside", "Systems")] | |
public void ProjectsTopsides_vs_ProjectsSystems(string one, string another) | |
{ | |
// Act | |
var fuzzyMatchValue = one.FuzzyMatch(another); | |
var diceCoefficient = one.DiceCoefficient(another); | |
var levenshteinDistance = one.LevenshteinDistance(another); | |
var lcs = one.LongestCommonSubsequence(another); |
NewerOlder