public Sorter() { this._FirstPasses = new FirstPasses(); this._FirstDescendingPasses = new FirstPasses(); this._NextPasses = new NextPasses(); this._NextDescendingPasses = new NextPasses(); }
internal Sorter() { _firstPasses = new FirstPasses(); _firstDescendingPasses = new FirstPasses(); _nextPasses = new NextPasses(); _nextDescendingPasses = new NextPasses(); var type = typeof(T); type .GetProperties(BindingFlags.Instance | BindingFlags.Public) .ToList() .ForEach(x => { var parameter = Expression.Parameter(type, "x"); var body = Expression.Property(parameter, x); var delegateType = typeof(Func <,>).MakeGenericType(type, x.PropertyType); dynamic expression = Expression.Lambda(delegateType, body, parameter); Register(expression); }); }