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 NullableDictionary<TKey, TValue> : IDictionary<TKey?, TValue> where TKey : struct | |
{ | |
private bool _hasNull; | |
private TValue _nullKeyValue; | |
private readonly Dictionary<TKey, TValue> _dictionary; | |
public NullableDictionary(): this(0, null) { } | |
public NullableDictionary(int capacity): this(capacity, null) { } |
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
WITH CTE AS | |
( | |
SELECT ProductId, [CustomerOrderNumber] = ROW_NUMBER() OVER(PARTITION BY [CustomerId] ORDER BY [DateCreated]) | |
FROM [Sales] | |
) | |
SELECT ProductId, SUM(IIF(CTE.CustomerOrderNumber = 1, 1, 0)) | |
FROM CTE | |
GROUP BY ProductId |
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
[core] | |
whitespace=trailing-space,space-before-tab | |
[apply] | |
whitespace=fix | |
* binary | |
*.[sS][lL][nN] text=auto diff merge | |
*.[cC][sS][pP][rR][oO][jJ] text=auto diff merge | |
*.[vV][bB][pP][rR][oO][jJ] text=auto diff merge | |
*.[vV][cC][xX][pP][rR][oO][jJ] text=auto diff merge | |
*.[vV][cC][pP][rR][oO][jJ] text=auto diff merge |
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; | |
/// <summary> | |
/// DisposableBase class. Represents an implementation of the IDisposable interface. | |
/// </summary> | |
public abstract class DisposableBase : IDisposable | |
{ | |
/// <summary> | |
/// A value which indicates the disposable state. 0 indicates undisposed, 1 indicates disposing |
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.IO; | |
using System.Text; | |
using System.Web.Mvc; | |
using Newtonsoft.Json; | |
namespace XXX | |
{ | |
public class JsonNetResult<T> : ActionResult | |
{ |
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
$packages = "Microsoft.CodeAnalysis.Analyzers", "Microsoft.CodeAnalysis.Common", "Microsoft.CodeAnalysis.CSharp", "Microsoft.CodeAnalysis.CSharp.Workspaces", "Microsoft.CodeAnalysis.Workspaces.Common", "Microsoft.Composition", "NuGet.CommandLine", "System.Collections.Immutable", "System.Reflection.Metadata" | |
$packages | foreach {Install-Package $_} |
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
vs_community.exe --addProductLang en-US ^ | |
--add Microsoft.VisualStudio.Workload.Azure ^ | |
--add Microsoft.VisualStudio.Workload.Data ^ | |
--add Microsoft.VisualStudio.Workload.DataScience ^ | |
--add Microsoft.VisualStudio.Workload.ManagedDesktop ^ | |
--add Microsoft.VisualStudio.Workload.NativeDesktop ^ | |
--add Microsoft.VisualStudio.Workload.NetCoreTools ^ | |
--add Microsoft.VisualStudio.Workload.NetWeb ^ | |
--add Microsoft.VisualStudio.Workload.Node ^ | |
--add Microsoft.VisualStudio.Workload.VisualStudioExtension ^ |
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
[Obsolete("Use BaseUriClient instead")] | |
public abstract class BaseClient<TService> : IDisposable | |
{ | |
private static readonly Dictionary<MethodBase, string> _templatesForMethods = new Dictionary<MethodBase, string>(); | |
private const int MAX_STACKFRAME_NESTING = 10; | |
private readonly RestClient _client; | |
private readonly Uri _baseSubUri; |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
namespace Helpers | |
{ | |
/// <summary> |
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 Microsoft.AspNetCore; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
namespace SelfHostAspCoreExample | |
{ | |
public class Program | |
{ |