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
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false, Inherited = true)] | |
public class ValidateJsonAntiForgeryTokenAttribute : FilterAttribute, IAuthorizationFilter | |
{ | |
public void OnAuthorization(AuthorizationContext filterContext) | |
{ | |
if (filterContext == null) | |
{ | |
throw new ArgumentNullException("filterContext"); | |
} |
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
public static int CombineHashCodes(params int[] hashCodes) | |
{ | |
if (hashCodes == null) | |
{ | |
throw new ArgumentNullException("hashCodes"); | |
} | |
if (hashCodes.Length == 0) | |
{ | |
throw new IndexOutOfRangeException(); |
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.CodeDom; | |
using System.Collections.Generic; | |
using System.Linq; | |
using BoDi; | |
using TechTalk.SpecFlow.Generator; | |
using TechTalk.SpecFlow.Generator.Configuration; | |
using TechTalk.SpecFlow.Generator.Plugins; | |
using TechTalk.SpecFlow.Generator.UnitTestConverter; | |
using TechTalk.SpecFlow.Generator.UnitTestProvider; |
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.Linq; | |
using System.Threading; | |
namespace LinqExtensions | |
{ | |
public static class EnumerableExtensions | |
{ | |
/// <summary> |
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
/// <summary> | |
/// Gets value from DataReader. Handles <see cref="DBNull"/>. | |
/// </summary> | |
/// <typeparam name="T">Any type including <see cref="Nullable{T}"/> values.</typeparam> | |
/// <param name="reader"></param> | |
/// <param name="columnName"></param> | |
/// <returns></returns> | |
public static T GetValue<T>(this IDataReader reader, string columnName) | |
{ | |
var value = reader[columnName]; |
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; | |
using System.Collections.Generic; | |
namespace ConsoleApplication10 | |
{ | |
public class BinarySearchTreeSet<T> : ICollection<T> | |
{ | |
private readonly IComparer<T> _comparer; |
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
/// <summary> | |
/// Heap's algorithm. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="source"></param> | |
/// <returns></returns> | |
public static IEnumerable<T[]> GetAllPermutations<T>(IEnumerable<T> source) | |
{ | |
var result = source.ToArray(); |
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
/// <summary> | |
/// Merge two sorted arrays. | |
/// </summary> | |
/// <param name="a"></param> | |
/// <param name="b"></param> | |
/// <returns></returns> | |
public static IEnumerable<int> Merge(int[] a, int[] b) | |
{ | |
int i = 0; | |
int j = 0; |
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.Linq; | |
using System.Web.Http.Description; | |
using Newtonsoft.Json.Serialization; | |
using Swashbuckle.Swagger; | |
namespace Swagger.Configurations | |
{ | |
public class SwashbuckleDocument |
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.Collections.Generic; | |
using System.Linq; | |
using Newtonsoft.Json.Linq; | |
namespace OpenApi.Extensions | |
{ | |
/// <summary> | |
/// Consolidates enums based on <code>x-type-fullname</code> vendor extension. | |
/// <example> | |
/// { |
OlderNewer