System.Linq.Dynamic using ?? c# operador

c# dynamic-linq linq

Question

To avoid having to use the IIF operator on lengthy chains, I would like to use the?? operator.

Example:

customers.Select ("new (CompanyName as Name, Phone)");

customers.Select ("new (CompanyName as Name, iif (Phone = null, string.Empty, Phone) as Phone)");

customers.Select ("new (CompanyName as Name, (Phone ?? string.Empty) as Phone)");

Or maybe there is another approach.

1
1
9/9/2015 10:45:46 PM

Popular Answer

watch zzz-5 zzz
and 11 to zz

Dynamic Linq translates a string to its Linq equivalent. You may even get the source code from links and inspect the string options' parsing.

I recently examined the library, and I believe there are extremely little chances that it might fulfill your request.
the emblem Id enum conveys a lot about the potential. This is what I saw when I first opened the Parser.

 private enum TokenId {
        Unknown,
        End,
        Identifier,
        StringLiteral,
        IntegerLiteral,
        RealLiteral,
        Exclamation,
        Percent,
        Amphersand,
        OpenParen,
        CloseParen,
        Asterisk,
        Plus,
        Comma,
        Minus,
        Dot,
        Slash,
        Colon,
        LessThan,
        Equal,
        GreaterThan,
        Question,
        OpenBracket,
        CloseBracket,
        Bar,
        ExclamationEqual,
        DoubleAmphersand,
        LessThanEqual,
        LessGreater,
        DoubleEqual,
        GreaterThanEqual,
        DoubleBar
    }
1
9/9/2015 11:06:00 PM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow