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 ToBase36String(byte[] toConvert) | |
{ | |
const string alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; | |
BigInteger dividend = new BigInteger(toConvert); | |
var builder = new StringBuilder(); | |
while (dividend != 0) | |
{ | |
dividend = BigInteger.DivRem(dividend, 36, out var remainder); | |
builder.Insert(0, alphabet[Math.Abs((int)remainder)]); | |
} |
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 StringToExpression.LanguageDefinitions; | |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using StringToExpression.GrammerDefinitions; | |
using System.Linq.Expressions; | |
using System.Linq; | |
using StringToExpression.Util; | |
using System.Reflection; |
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 System.Reflection; | |
namespace StringParser.Util | |
{ | |
public static class Type<T> | |
{ | |
/// <summary> | |
/// Find a MemberInfo based on a linq 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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ExpressionUtil | |
{ | |
public class ExpressionMapping |
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.Linq.Expressions; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Web.Http.OData.Query; | |
namespace ExpressionUtil | |
{ |
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.Linq.Expressions; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ExpressionUtil | |
{ | |
public class FindVisitor : ExpressionVisitor |
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.Linq; | |
using System.Linq.Expressions; | |
public sealed class ExpressionComparer : IEqualityComparer<Expression> | |
{ | |
public NameComparison CompareLambdaNames { get; set; } | |
public NameComparison CompareParameterNames { get; set; } |
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 Expression<Func<T, bool>> ParseODataFilterString<T>(string odataQueryString) | |
{ | |
var query = new List<T>().AsQueryable().LinqToQuerystring("?$filter="+ odataQueryString); | |
var methodCall = query.Expression as MethodCallExpression; | |
if (query == null | |
|| methodCall.Method.Name != "Where" | |
|| methodCall.Method.DeclaringType != typeof(Queryable)) | |
throw new Exception("cannot process filter query"); |
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.Data.Common; | |
using System.Data.SqlClient; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; |
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.Reflection; | |
using System.Reflection.Emit; | |
using System.Threading; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Collections.Concurrent; |
NewerOlder