System.Linq.Dynamic.Core
System.Linq.Dynamic.Core copied to clipboard
Documentation: better description of enum parsing
When describing how Dynamic LINQ handles enum values embedded inside the Dynamic LINQ string, the documentation states:
The expression language supports an implicit conversion from a string literal to an enum type provided the string literal contains the name of a member of that enum type.
- The use of the term "string literal" makes it sound as though
DayOfWeek.Mondaymight have to be embedded in quotes within the Dynamic LINQ string:"OrderDate.DayOfWeek = \"DayOfWeek.Monday\""; or that the only way to use this functionality would be to pass in a string as a value:.Where("OrderDate.DayOfWeek = @0", "DayOfWeek.Monday"). I've tested both of these, and neither of them work. - It's not enough to include the name of the member:
Monday-- you also have to include the name of the type:DayOfWeek.Monday
A better wording might be something like:
The expression language supports an implicit conversion from the enum type and member --
DayOfWeek.Monday-- to the appropriate enum type.