You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is supposed to demonstrate how Dynamic LINQ parses a string literal embedded inside a Dynamic LINQ string as an enum. But the example only shows how it's possible to pass in an actual enum value to Dynamic LINQ, via the @0 parameter. A better example would be:
where the enum value is itself embedded as a string literal inside the Dynamic LINQ string.
Also, it should be noted that as of #450 , all the enum types defined in mscorlib are available directly, not as string literals. So to use DayOfWeek, it doesn't need to be wrapped in ":
a constant enum value can be specified using it's name in one of three ways:
As an embedded string literal of the name without the type name: MyEnum1 = "First" "First" = MyEnum1
Passing in the enum value as a Dynamic LINQ argument: MyEnum1 = @0 @0 = MyEnum1
while passing in MyEnum.MyEnum1
If the enum is one of the predefined enums (as of Support the enum UriKind #450, all the enums in mscorlib), or explicitly added to the accessible types using a custom type provider, the enum value can be referenced directly via the type name: DOW = DayOfWeek.Tuesday DayOfWeek.Tuesday = DOW.
The following example:
is supposed to demonstrate how Dynamic LINQ parses a string literal embedded inside a Dynamic LINQ string as an enum. But the example only shows how it's possible to pass in an actual enum value to Dynamic LINQ, via the
@0
parameter. A better example would be:where the enum value is itself embedded as a string literal inside the Dynamic LINQ string.
Also, it should be noted that as of #450 , all the enum types defined in mscorlib are available directly, not as string literals. So to use
DayOfWeek
, it doesn't need to be wrapped in"
:The text was updated successfully, but these errors were encountered: