Formatting LINQ

Thread is closed for posting
2 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 15 Apr 2011 Link to this post

    I have found myself writing code like this a lot lately...
    foldersToBeUpdated.Where(f=>blah).Select.(f=> MoreBlah).ToList().Foreach(f=> {
    f.Something = somethingelse; = bar;

    Sometimes the statements can go on a bit. So, to make it a bit more readable, I've been doing this...
        .Select.(f=> MoreBlah)
                    f.Something = somethingelse;
           = bar;
     (Format painter is messing with the spacing inside the {} brackets).

    However, JC, when asked to format the code turns it in to this ...
    .Select.(f=> MoreBlah)
         f.Something = somethingelse; = bar;

    I would have thought that the 2nd and subsequent lines of the LINQ statement should have been indented below the first.

    Hardly the end of the world, I know, but...


  2. Blagoev
    Blagoev avatar
    49 posts

    Posted 26 Apr 2011 Link to this post

    Hello Stuart Hemming,
    We are planning on improving the formatter for the next release this problem is high on our list. Hopefully it will be included in our future internal builds

    Best wishes,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top