Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [expression-trees]

Expression Trees are an abstract representation of code in a tree structure where each node of the tree represents a programming construct (conditional, assignment, method call, etc.)

Filter by
Sorted by
Tagged with
4 votes
2 answers
352 views

Preface I need to generate some algebraic expressions for math testing in elementary school. The test should generate a list of expressions compiled according to certain rules and check the ...
chptr-one's user avatar
  • 495
0 votes
1 answer
82 views

I have created a simple abstract class called expr_node which will serve as a base class for any expression-related nodes. My goal is to create a simple deleter ...
Desmond Gold's user avatar
4 votes
1 answer
7k views

As you might know, EF Core does not support executing multiple queries in parallel on the same context using something like Task.WhenAll. So you have to write this ...
wertzui's user avatar
  • 188
8 votes
2 answers
389 views

There aren't enough questions about creating immutable objects... so why not try it again with another approach. This time, it's a builder that maps properties to constructor parameters. Properties ...
t3chb0t's user avatar
  • 44.7k
3 votes
1 answer
529 views

Here is my solution for the Daily Coding Challenge 50 Given an arithmetic expression in the form of a binary tree, write a function to evaluate it Example ...
MrJoe's user avatar
  • 2,173
6 votes
3 answers
498 views

Quite some time ago I have created the Simple object validator (see also self-answer). The more I used it the more I thougt its API could be better so I have heavily refactored it and would like to ...
t3chb0t's user avatar
  • 44.7k
2 votes
1 answer
122 views

I'm working with a large enterprise SQL Server database with dozens of tables that are used mainly as lookups to populate dropdown lists, etc. These tables all follow the convention of having (table)...
Valuator's user avatar
  • 189
3 votes
0 answers
60 views

My FeatureSerivce provides only basic APIs, so it is good in dealing with single features. Like I can configure only one feauture at a time: ...
t3chb0t's user avatar
  • 44.7k
2 votes
2 answers
153 views

There are many APIs that require some kind of a string key/name. I usually try to avoid using raw strings and prefer to use ...
t3chb0t's user avatar
  • 44.7k
7 votes
2 answers
499 views

Inspired by the various quiz programs on this site, as well as Simon Tatham's puzzle collection, I thought I'd write a quiz that constructs its questions automatically and randomly. A typical session ...
Roland Illig's user avatar
  • 21.9k
5 votes
1 answer
2k views

I need to evaluate some data. The rules how it should be done are changing frequently (it's an evolving model) so I don't want to rewrite my application each time such a change comes. I'd rather do it ...
t3chb0t's user avatar
  • 44.7k
4 votes
1 answer
365 views

In one of my frameworks that I use with many tools I have an ExpressionVisitor whose job is to resolve the exact property, it's declaring type and instance. I ...
t3chb0t's user avatar
  • 44.7k
1 vote
1 answer
490 views

A simple binary expression tree in Haskell without operator precedence and without parentheses. Any comments would be much appreciated. ...
Lumon's user avatar
  • 51
14 votes
3 answers
549 views

I've needed a couple of very special comparers recenty and didn't want to implement each one of them every time so I created a builder and a couple of supporting classes that do that for me. Example ...
t3chb0t's user avatar
  • 44.7k
8 votes
4 answers
1k views

There is a way in Scala to selectively change a field while making a copy of the immutable object: ...
Dmitry Nogin's user avatar
  • 6,131
6 votes
1 answer
323 views

I'm working on a binary space partition tree. For the time being, the nodes are only inserted into the right. A node that has children will have 0 as data. Here are the insertion rules. If the ...
bl4ckb0ne's user avatar
  • 263
13 votes
3 answers
1k views

The DebuggerDisplayAttribute is a very helpful feature. But creating those strings is an extremely tedious task. I wanted to make it a no-brainer so that I can ...
t3chb0t's user avatar
  • 44.7k
2 votes
0 answers
145 views

I have created this method to simulate SQL's IN operator: ...
mshwf's user avatar
  • 121
14 votes
6 answers
12k views

I need to store serialized objects in a database and I want to avoid duplicates. In order to be able to tell wheter an object is already stored, I have to compare them somehow. My idea was to ...
t3chb0t's user avatar
  • 44.7k
20 votes
6 answers
17k views

I wrote a simple validation tool that allows me to quickly define validation rules and check my data objects against them. I know there is this another tool called FluentValidation but... I'm not a ...
t3chb0t's user avatar
  • 44.7k
6 votes
4 answers
1k views

I've been improving some of my old sequence generators that worked with generics and lambdas in order to support binary operators for the specified T: ...
t3chb0t's user avatar
  • 44.7k
9 votes
5 answers
736 views

Writing comparers by either implementing the IEqualityComparer<T> or the IEquatable<T> interface is another boring ...
t3chb0t's user avatar
  • 44.7k
2 votes
1 answer
485 views

This time I'd like you to review my unit-test helpers for binary operators. I wrote them because I'm often to lazy to test these operators because writing those tests is so boring. My little helpers ...
t3chb0t's user avatar
  • 44.7k
8 votes
1 answer
4k views

Linq to Object GroupBy extension method allows grouping by projection: ...
Dmitry Nogin's user avatar
  • 6,131
5 votes
1 answer
2k views

I'd like to make the usage of my configuration framework easier so I created a few extensions that after getting a value from a source automatically assign it to a property or field. They should make ...
t3chb0t's user avatar
  • 44.7k
2 votes
0 answers
98 views

I have a system that parses a mathematical expression String, creates a derivative expression tree, and reconstructs the derived expression into a new ...
defoification's user avatar
5 votes
1 answer
4k views

I have a JSON configuration file where the user is allowed to use inside strings certain placeholders {Type.Name} that later will be interpolated with the actual ...
t3chb0t's user avatar
  • 44.7k
5 votes
1 answer
9k views

I wasn't happy with my last attempt to parse a cron expression so I simplified it and now I use regex instead. I'd like you to take a look at this solution whether I'm doing something terribly wrong. ...
t3chb0t's user avatar
  • 44.7k
5 votes
1 answer
207 views

I have this expression: ...
sDima's user avatar
  • 889
4 votes
1 answer
969 views

This is a follow on to Part 1 In order to use my new Specifications within expression trees so I can use them in projections/navigation collections I had to write ...
RobH's user avatar
  • 17.1k
9 votes
2 answers
3k views

I've been experimenting with different ways of reusing (and naming) the expressions I use in Entity Framework. I've tried static fields with Expressions and ...
RobH's user avatar
  • 17.1k
7 votes
1 answer
379 views

Up until recently, my LINQ-to-Sage provider didn't support projections, so the client code had to explicitly "transfer" to LINQ-to-Objects, like this: ...
Mathieu Guindon's user avatar
3 votes
1 answer
331 views

I've been working on another timesaver because I really really don't like to type all those validation ifs and exceptions over an over again. What I came up with ...
t3chb0t's user avatar
  • 44.7k
4 votes
1 answer
381 views

I am building out a binary expression tree and shown below is an implementation of the tree's node. The node can be either a leaf or non-leaf, with leaves having ...
Sloth Armstrong's user avatar
6 votes
1 answer
10k views

There are a number of topics pertaining to entity change tracking. All the ones I've seen involve either 1) notifying when a property has changed or 2) merely determining whether or not an entity is ...
oscilatingcretin's user avatar
2 votes
1 answer
3k views

I am creating a way for users to filter results based on start and end values. An example of this would be: ...
GBreen12's user avatar
  • 121
10 votes
1 answer
298 views

Following-up on my last question where I wrapped the Sage API with a familiar IRepository interface, I decided to push the abstraction a step further, and... ...
Mathieu Guindon's user avatar
12 votes
2 answers
357 views

Ok, before you ask: yes, I need to do this. Sort of. I'm wrapping a 3rd-party API for data access, and I can't use an ORM, so I'm implementing this kind of thing: ...
Mathieu Guindon's user avatar
7 votes
1 answer
386 views

This small utility class is my solution for a more convenient way for checking against null. I also wanted to have more informative NullReferenceExceptions but I ...
t3chb0t's user avatar
  • 44.7k
-1 votes
1 answer
568 views

Is there any way I can refactor this expression tree? ...
Sarawut Positwinyu's user avatar
10 votes
3 answers
26k views

As far as I know the standard Delegate.CreateDelegate() which allows to create a delegate by using reflection, doesn't allow doing something as follows when the ...
Steven Jeuris's user avatar