Bug when formatting Linq query

4 posts, 1 answers
  1. miksh
    miksh avatar
    275 posts
    Member since:
    Nov 2006

    Posted 06 Dec 2011 Link to this post

    See code below when applying code formatting - lost space before join/where/select.
    // BEFORE:
                        cards = cards
                                   .Select(c => c)
                                   .Except(from cc in cards
                                           join ee in eExclusions on cc.EventId equals ee.EventId
                                           where ee.CommunityCode == communityCode
                                           select cc).ToList();
     
     
     
    // AFTER:
                        cards = cards
                                     .Select(c => c)
                                     .Except(from cc in cardsjoin ee in eExclusions on cc.EventId equals ee.EventIdwhere ee.CommunityCode == communityCodeselect cc)
                                                 .List();
  2. Answer
    Borislav
    Admin
    Borislav avatar
    35 posts

    Posted 07 Dec 2011 Link to this post

    Hi Miksh,

    We have already fixed this problem. The fix will be available in our next release.

    We are sorry for the inconvenience. Please stay tuned for our future releases.

    Greetings,
    Borislav
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. miksh
    miksh avatar
    275 posts
    Member since:
    Nov 2006

    Posted 07 Dec 2011 Link to this post

    Great, thanks.

    Btw, is there a way to configure the Linq expression formatting, e.g. in the sample above to format it as follows, i.e. anythign startied with "from", "join", "where", "select" etc to start from a new line?

    cards = cards
                          .Select(c => c)
                          .Except(from cc in cards
                                       join ee in eExclusions on cc.EventId equals ee.EventId
                                       where ee.CommunityCode == communityCode
                                       select cc)
                           .ToList();

  5. Borislav
    Admin
    Borislav avatar
    35 posts

    Posted 08 Dec 2011 Link to this post

    Hi Miksh,

    There is no way to apply a specific formatting style on linq query for the moment. I will log this into our system and we will try to do it as soon as possible.

    All the best,
    Borislav
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top