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 string ConvertToQueryString(NameValueCollection queryParameters) | |
{ | |
return string.Join("&", queryParameters.AllKeys | |
.Select(a => $"{HttpUtility.UrlEncode(a)}={HttpUtility.UrlEncode(queryParameters[a])}")); | |
} |
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 Uri Append(this Uri uri, params string[] paths) | |
{ | |
return new Uri(paths.Aggregate(uri.AbsoluteUri, | |
(current, path) => string.Format("{0}/{1}", current.TrimEnd('/'), path.TrimStart('/')))); | |
} |
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 string DictionaryToString(Dictionary<string, string> d) | |
{ | |
// Build up each line one-by-one and then trim the end | |
StringBuilder builder = new StringBuilder(); | |
foreach (KeyValuePair<string, string> pair in d) | |
{ | |
builder.Append(pair.Key).Append(":").Append(pair.Value).Append(",\n"); | |
} | |
string result = builder.ToString(); | |
return result; |
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.Linq.Expressions; | |
using Moq.Language.Flow; | |
namespace Moq | |
{ | |
public static class MoqExtensions | |
{ | |
public static ISetup<T, TResult> SetupIgnoreArgs<T, TResult>(this Mock<T> mock, | |
Expression<Func<T, TResult>> expression) |
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 Net.Pkcs11Interop.Common; | |
using Net.Pkcs11Interop.HighLevelAPI; | |
using Net.Pkcs11Interop.PDF; | |
using Org.BouncyCastle.Crypto.Parameters; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Security; |
NewerOlder