Use this tag for code reviews of or involving Linq to SQL classes, mappings and associations, or for code reviews of or involving querying a System.Data.Linq.DataContext object with Linq statements.

learn more… | top users | synonyms

4
votes
1answer
98 views

Inserting customer care database analysis detail records

I have written this linq-to-sql query to insert a bunch of customer care database analysis detail records: ...
2
votes
2answers
91 views

Delayed Include rules for EntityTypeConfiguration using LINQ expressions

The aim of this class is to set rules for including navigational properties on Configuration level and then apply where needed in the code. I've decided to store expressions in the list for different ...
1
vote
1answer
54 views

Converting table data into nested JSON

I'm new to C# (coming from a JavaScript background) and it seems like this code could be greatly improved. This SQL query: ...
2
votes
1answer
75 views

Checking for user permissions

The idea here is we have Roles, Permissions, and a table called PermissionRoles that connect the two. So a Permissions can be in many Roles, and many Permissions can have the same Role. So what the ...
3
votes
1answer
92 views

Linq-to-SQL DAL on a Windows Forms project

I just started out a new job as a C# programmer on .NET 3.5. My manager gives me total independence on how I build my modules, which is generally a good thing, but there are minuses too. Having too ...
3
votes
1answer
102 views

Extension method to do Linq Lookups

Does this extension method contain unnecessary work? - Thanks for reviewing Scenario - A series of tables are Key-Value pairs (Int "Id" / nvarChar "Title"). This extension method "dots-off" any ...
0
votes
1answer
217 views

Simplify IQueryable Linq to SQL query

Below I present to you an IQueryable LINQ to SQL query (used with NHibernate). I have tried to simplify this query but I could not do it. I want to run a query for searching information. Options: ...
2
votes
1answer
173 views

Why is loading images taking so long?

When Page_Load is executed I assign the ImageUrl which is a IHTTPHandler: ...
3
votes
3answers
556 views

Code optimization by constant if-structure iteration removal

Below you will find the specific code that I am attempting to optimize. I have a method previous to called getCount() which, based on similar parameters as below, ...
2
votes
2answers
357 views

Linq C# pulling from table row into input fields

Today is the first time I've used Linq, so I wanted to get a code review on this and make sure I'm going about it correctly. I'm filling text boxes and dropdown lists from a table row. ...
10
votes
1answer
327 views

Password Manager UI: Populating DataGridView is Painfully Slow

I'm designing a small account/password manager using C# and SQL Server CE. LINQ to SQL is my ORM of choice. Here's the data model representing how the SQL Server CE database is set up: And here's ...
6
votes
1answer
5k views

A generic way to use LINQ to Entity with types and operations unknown until run time

A question was asked here about reflection and LINQ to entity. I'm trying to modify the code that was presented to fit my needs. Here's what I am trying to accomplish: I'm writing back-end support ...
7
votes
1answer
871 views

Redundant DataContext ? - LINQ to SQL

This seems like a pretty basic question, so bear with me...Say I have two (or many) methods in the same class that need a LINQ to SQL DataContext. Additionally, I am needing the DataContext in other ...
2
votes
3answers
157 views

How to make my code faster and easier?

This is my .cs part code where I am calling storeprocedure in LINQ to SQL: ...
7
votes
1answer
142 views

Does this unusual data access pattern create any problems?

The background Two beginners without access to an experienced mentor write an ASP .NET MVC application, mostly simple CRUD, using Linq to SQL for the data access layer. Beginner number 1 writes the ...
3
votes
1answer
267 views

LINQ statement to aggregate data

Teachers can raise 'dramas' which are when students forget equipment, don't do homework or are flagged for concern. Each drama for each student is stored as a separate record. I seek a list of all ...
7
votes
1answer
283 views

Comparison table for comparing products

I'm attempting to create a comparison table to compare products depending on the add-ons they have. To grab the data and filter it I'm using LINQ To SQL. Table's Layout (cut short): ...