Skip to main content
0 votes
2 answers
121 views

How to write a linq query that does the same as this SQL statement: select * from [dbo].[LitEdit] as le inner join [dbo].[LitEditJob] as lej on lej.BulkEditId = le.Id inner join [dbo].[...
mangg's user avatar
  • 63
1 vote
1 answer
120 views

I am trying to use a non-mapped class property in Entity Framework that takes two properties from Entity Framework and checks if one is null, and if it is uses the other property. Example: class examp ...
David Hubner's user avatar
3 votes
2 answers
229 views

Imagine the following classes (much simplified version of the real use case): public class Driver { public Int32 Id { get; set; } public String Name { get; set; } public String Country { ...
MythJuha's user avatar
Advice
0 votes
1 replies
33 views

Let's say I have a List<myObject> in which there are 10 instances of myObject. myObject has two properties: Name and PhoneNumber. I need a new List<string> taking the Name property from ...
Jesse Liberty's user avatar
2 votes
1 answer
95 views

Since a few days, code that has always worked, fails on Azure with an Exception "NotSupportedException: Specified method is not supported.". This Exception occurs when building the query ...
Edwin's user avatar
  • 605
2 votes
3 answers
230 views

Let's say I have this method. Assume Items is an array of strings: public int GetCount(char c) { return Items.Count(x => x.Contains(c)); } I know that C# creates a closure for Count(x => x....
user3163495's user avatar
  • 4,046
2 votes
1 answer
120 views

I have a list of records, by multiple UserID's. TableID UserID Status ------------------------ 1 3 3 2 4 3 3 3 4 4 4 3 5 5 4 6 ...
Sherry8212's user avatar
0 votes
2 answers
167 views

I have a folder containing huge numbers of files in many subfolders, and I want to select the files with a name that matches any of a specified list of patterns (regular expressions). My regular ...
Theodor Zoulias's user avatar
7 votes
1 answer
270 views

I'm experimenting with C# Expression Trees and trying to understand the difference between Expression.Return and Expression.Goto. I can’t create an example where Return and Goto behave differently ...
Neomaster's user avatar
5 votes
6 answers
208 views

I have a list of items that contains duplicates, and I want to keep the last item of each group of duplicates. The native DistinctBy LINQ operator keeps the first item from each group, so it doesn't ...
Theodor Zoulias's user avatar
0 votes
3 answers
131 views

Working in C# with a custom object that has multiple rows and columns. I need to remove duplicate records where some (but not all) of the column values match, including positive and negative values of ...
MF Luder's user avatar
  • 380
1 vote
1 answer
157 views

Microsoft have changed ExecuteUpdateAsync to accept non-expression setters parameter in NET 10. Now it works this way: await context.Blogs.ExecuteUpdateAsync(s => { s.SetProperty(b => b....
Stanislav Gordenko's user avatar
Advice
0 votes
5 replies
106 views

I have the following use case: the database contains a row with a nullable column, and I would like to request only that column value from the database for a single row. This can easily be done using ...
R. Hoek's user avatar
  • 1,145
-5 votes
2 answers
209 views

Is there a way I can get the last five years of an object? I been trying to use Max to get the maximum year and then use range to get all the objects within that range: using System; using System.Linq;...
Jefferson's user avatar
  • 119
1 vote
1 answer
110 views

I am trying to use the InsertFromQuery() to add data to a SQL table: await cx.Users .Where(x => x.Country == "Romania") .InsertFromQueryAsync("Mailbox", mb => ...
Ginto's user avatar
  • 41

15 30 50 per page
1
2 3 4 5
5787