Questions tagged [linq]

Language INtegrated Query (LINQ) is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages.

17 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
129 views

Implement Sudoku using LINQ

WiKi and GitHub. Sudoku rules are being checked with the following tests: ...
  • 6,123
4 votes
0 answers
135 views

Repository pattern method implementation with entity framework and C#

I have two entities in my database: Employee and Shift. I want to implement a C# repository pattern method, that given two ...
3 votes
0 answers
40 views

Configure multiple application features by common criteria

My FeatureSerivce provides only basic APIs, so it is good in dealing with single features. Like I can configure only one feauture at a time: ...
  • 44.1k
2 votes
0 answers
187 views

Generic search service to filter entries in lists

I'm in the process of implementing a fully generic service to filter out entries (of any type), which are contained in a ICollection. As it is generic, without any ...
  • 121
2 votes
0 answers
98 views

LINQ extensions for sequence comparing

The desired behavior would be: ...
  • 6,123
2 votes
0 answers
254 views

Handler for jQuery DataTable search with filters and pagination

This AjaxCompound is invoked every time when the user types a key for search or click to sort. It contains 1million data 10 distinct rows by compound name. It takes 1.1 minutes and return only 1-5 KB ...
2 votes
0 answers
121 views

Implementing the IQueryable counterpart method of the IEnumerable method?

I have created this method to simulate SQL's IN operator: ...
  • 121
2 votes
0 answers
307 views

Entity Join slow query

I've never participated in a codereview before and I was pointed that I should in another thread for a slow query. ...
  • 129
2 votes
0 answers
13k views

Retrieving Primary Key from Entity Framework entity

Entity Framework (version 6) generates classes based on your tables that look like this (where each property represents a field in the table): ...
  • 449
1 vote
0 answers
76 views

Filter out nulls from sequence of nullables to produce sequence of non-nullables

While introducing nullable reference types to our enterprise application's codebase, I found that we are often using LINQ on sequences of nullable reference types where we filter out the nulls using <...
  • 111
1 vote
0 answers
52 views

Optimizations on a function that fIlters a list of connections

Hello fellow programmers, I am currently implementing a function and wanted to know if there was anything I could change to simplify the code, make it more readable, or to optimize the running time ...
1 vote
0 answers
923 views

SelectAsync With Max Degree Of Parallelism

I have been looking for the best approach to creating an extension method that would give me the ability to select in a linq query using async/await with a max degree of parallelism. I'm aware that ...
  • 181
1 vote
0 answers
84 views

Getting all descendants IWebElements (using XPath) is too slow in Selenium

Well, I'm working with Selenium to scrape a webpage that has obfuscated class names (example <div class="example-gHJkLM">...)... So I needed to ...
  • 237
1 vote
0 answers
1k views

E-Commerce Mock App in Console

I have completed this E-Commerce Mock App in Console C# which I used object to store the data to apply some C# OOP and LINQ techniques. Since it is just a mock version, features are reduced to the ...
1 vote
0 answers
45 views

Querying a database to find notifications to comments

I have a solution what I think is not the best, and I want to make this not so expensive. I'm using MVC 5 + SignalR (hubs) + EF + UnitOfWork + Generic Repos. I have a table ...
1 vote
0 answers
230 views

Join via navigation properties with collection

There are some related collection objects in my table and I'm trying to get list with joining this tables. But this code is seems bad: Entities that shortened: User: ...
1 vote
0 answers
2k views

Create JSON object from self-nested LINQ query

I created this function to created nested JSON object using a Linq query. How can I optimize this and make it more readable? ...