System.Linq.Dynamic.Core icon indicating copy to clipboard operation
System.Linq.Dynamic.Core copied to clipboard

Documentation: better description of enum parsing

Open zspitz opened this issue 5 years ago • 0 comments

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.Monday might 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.

zspitz avatar Oct 21 '20 17:10 zspitz