댓글로 달린 많은 글들로 LINQ 활용에 대한 참고가 될 만합니다. 대부분의 분들이 메소드 방식을 선호하나 쿼리 방식의 깔끔함에 대해 강조하는 분들도 꽤 있습니다.
여러분의 경험은 어땠나요?
opened 07:29PM - 26 Sep 22 UTC
question
area-System.Linq
The .NET team is trying to better understand the community's usage of LINQ in re… al world applications. Since LINQ was first introduced in .NET 3.5, there have been well-known performance issues—[as evidenced by a simple web search](https://www.bing.com/search?q=dotnet+linq+performance). However, these performance issues are not all the same, since some applications put more weight on the expressiveness of LINQ relative to its performance. The community has also created solutions that create optimized code for certain LINQ expressions, for example [LinqOptimizer](https://nessos.github.io/LinqOptimizer/).
The goal of this survey is simply to understand common LINQ usage patterns and the problems they solve. We are also keen to understand why people use LINQ. We are asking the community to help us focus our attention on where we can look to improve performance that matters to you.
Please comment on this issue answering the following questions. If there is already a comment that has an example that captures your scenario, "thumbs up" the comment instead. Try to limit one LINQ expression per comment (post multiple comments if you have multiple examples); this way the "thumbs up" mechanism is more effective for others to indicate their agreement. If you prefer feel free to reach out directly via email to @AaronRobinsonMSFT or @elinor-fung; our email addresses can be found in our respective Github profiles.
We will be following this survey issue for the next two weeks after which point it will be closed. Thank you.
## Questions:
1) Do you primarily use LINQ using the [Query syntax](https://learn.microsoft.com/dotnet/csharp/linq/write-linq-queries#example---query-syntax) or the [Method syntax](https://learn.microsoft.com/dotnet/csharp/linq/write-linq-queries#example---method-syntax)?
1) Please share or link to a representative example of your use of LINQ. Include:
* A short description of the goal of the expression
* How often it is executed
* Version of .NET that runs the expression (for example, .NET Framework 4.5, .NET 6+)
1) If you have intentionally avoided LINQ due to performance issues, please share an example of:
* The problematic LINQ expression (if available) and the code that replaced it
* A short description of the goal
* How often it is executed
2개의 좋아요
suwoo
9월 29, 2022, 11:10오후
#2
predicate<T>
가 많이 들어갈 것 같으면 method syntax를,
한 눈에 읽기 편하고 수정될 일이 적을 것 같으면 query syntax를 많이 썼던 것 같습니다.
그리고 method syntax가 디버깅 할 때 훨씬 편리할 것 같습니다.
여차하면 줄바꿈 한 다음 중단점 찍는 것도 가능하니까요.
2개의 좋아요