API v2 uses LINQ expression parser that use syntax that is very close to standard .NET syntax. There are some difference:
- Casts are supported via
Assignable.As<UserStory>. You can access any simple or reference field of a specific type, like:
Assignable.As<UserStory>.Epic.Name. Collections on casted entities are not supported!
- You can use Convert class to convert strings to numbers or dates or vice versa.
- Decimal values are converted to double(nullable double) automaticaly in case double and decimal values are used in one expression: result of
it.Double + it.Decimaland
it.NullableDouble * it.Decimalwill be
double?. You don't need to use
Convert.ToDouble(it.Decimal). This also works for IFNONE/IIF operators: you can simply write
IIF(it.NullableDecimal.HasValue, it.NullableDecimal.Value, it.Double).
- Nullable bool is automaticaly converted to bool (false for null value). So if nullable bool is used in place where bool should be used it's usage will be converted from
it.NullableBool == True.
- Constructors are not supported, but you can construct your anonymous objects using syntax described above:
- You can use static methods of some types (DateTime, Convert, Guid). E.g.
- You can use Nullable types and checks for nulls
- You can use instance methods of simple types (e.g.,
- You can use IIF operator instead of
- You can use IFNONE operator:
- You can use operators (
/), comparisons (
==), Boolean constants (
false), string constants (
"Some string"), chars (
- Do not forget that
+sign is treated as space in URLs so do not forget to replace it with
- You can use operator
id in [1,2,3])
Also some limited subset of IQueryable methods are supported for nested collections (e.g. bugs of user story):
)- projection as described above
)- filters as described below
)(as well as Max, Min, Average) - aggregations over specified expression
)- count of filtered items
Updated about 4 years ago