All Regions
Argentina
Australia
Austria
Belgium (fr)
Belgium (nl)
Brazil
Bulgaria
Canada (en)
Canada (fr)
Catalonia
Chile
China
Colombia
Croatia
Czech Republic
Denmark
Estonia
Finland
France
Germany
Greece
Hong Kong
Hungary
Iceland
India (en)
Indonesia (en)
Ireland
Israel (en)
Italy
Japan
Korea
Latvia
Lithuania
Malaysia (en)
Mexico
Netherlands
New Zealand
Norway
Pakistan (en)
Peru
Philippines (en)
Poland
Portugal
Romania
Russia
Saudi Arabia
Singapore
Slovakia
Slovenia
South Africa
Spain (ca)
Spain (es)
Sweden
Switzerland (de)
Switzerland (fr)
Taiwan
Thailand (en)
Turkey
US (English)
US (Spanish)
Ukraine
United Kingdom
Vietnam (en)
Any Time
Past Day
Past Week
Past Month
Past Year
Gotta Get 'Em All - The Daily WTF
thedailywtf.com/articles/gotta-get-em-all
LINQ
brings functional programming and loads of syntactic sugar to .NET languages. It's a nice feature, although as James points out, it helps if your fellow developers have even the slightest clue about what they're doing. // some validation checking var retrieveDocIdList = this.storedDocumentManager.GetAllForClientNotRetrieved(client.Id).Select(x => x.Id.ToString(CultureInfo ...
Using LINQ - What the Daily WTF?
what.thedailywtf.com/topic/7787/using-linq
The
LINQ
part: About an hour into the first meeting I made up my mind that it would take longer to modify the old program then it would to just write it from scratch using C#, VS 2010. I had heard some buzz about
LINQ
so I spent a few days experimenting with it and decided it would be great for this demo phase.
How to do joins without join in C#/Linq? - What the Daily WTF?
what.thedailywtf.com/topic/14360/how-to-do-joins-without-join-in-c-linq
I'd look into querying the tables directly, calling ToList() on the resulting IEnumerables to pull them out of the data provider, and then doing the
LINQ
joins on the lists, as you'll be in
LINQ
to Objects then, which does support joins. The issue though is performance, so be sure to benchmark it.
Selecting distinct rows in Entity Framework - What the Daily WTF?
what.thedailywtf.com/topic/26874/selecting-distinct-rows-in-entity-framework
I'm pretty sure
LINQ
to Entities doesn't support that overload of Distinct(), since the query needs to be translated into SQL.I'm trying to avoid in-memory queries (
LINQ
to Objects). Edit: This page explicitly mentions that methods using IEqualityComparer aren't supported in
LINQ
To Entities. @Vixen said in Selecting distinct rows in Entity Framework: ...
An Operating Query - The Daily WTF
thedailywtf.com/articles/an-operating-query
2023-05-22T00:00:00.0000000
Sami inherited some C#
LINQ
code. The actual behavior and purpose of this code is fairly simple. The way the code was written, however, well… foreach (var operatingMode in ahu.CalculationData.OperatingModes) { operatingModesModel.OperatingModeNames.Add (operatingModeNumber, operatingMode.OperatingModeName); var innerOperatingModeNumber = operatingModeNumber; foreach (var property in from ...
Skip to the Loo - The Daily WTF
thedailywtf.com/articles/skip-to-the-loo
2023-02-08T00:00:00.0000000
Way back when Microsoft added
LINQ
to .NET, the real selling point was lazy evaluation. You could do something like var x = someList.Skip(3).Where((x) => x > 3).Take(5) and nothing would actually happen until you attempted to interact with the value of x. This can be especially great when interacting with a database, avoiding the round-trip until you actually need the data, and then only ...
Updates not updating in Linq to SQL - What the Daily WTF?
what.thedailywtf.com/topic/15391/updates-not-updating-in-linq-to-sql
The latest step in @jaloopa's Saga of Stupid Sage:. I need to get an ID from a counter table, then update the table ASAP to reduce the race condition. I'm within a DataContext using block, and running the following code:. var nextSequence = from c in context.Counters orderby c.CounterID descending select c; long nextID = nextSequence.First().NextValue; nextSequence.First().NextValue += 2 ...
Universal Catch - The Daily WTF
thedailywtf.com/articles/universal-catch
2023-08-08T00:00:00.0000000
I can't say I love the naming conventions, but it's a pretty straight forward C#
Linq
method, projecting and sorting data. I don't think that the ToList should be there, because we could be leveraging lazy evaluation (or maybe we shouldn't, I don't know their access patterns, but at a guess, lazy would be better here). Anything goes wrong, we ...
The Daily WTF: Curious Perversions in Information Technology
thedailywtf.com/articles/comments/gotta-get-em-all
That's just the thing,
LINQ
doesn't retrieve "all of every document needs enough memory for all documents at all times" unless you bodge it in a completely brain-dead manner, like putting a ToList() on the end. If you can't work with generators, you really shouldn't be working with databases in any way. Seeing ToList() on the end of a query is ...
XML Streaming Deserializer in C# - What the Daily WTF?
what.thedailywtf.com/topic/19904/xml-streaming-deserializer-in-c
So I think, "hey
LINQ
-to-XML,
LINQ's
all about streaming it must do that!" and it does, but, AFAICT, there's no way to make
LINQ
-to-XML type-aware. (Meaning: there's no way to get a XElement and say "hey this XElement is really this class, please convert for me thanx".) So I think, "hey XmlReader! It lets you stream the Xml data as it comes in!"
Feedback