Is anyone aware of whether there are there any built-in capabilities in the LINQ library (or a publicly available utility library) for optimized operations on IOrderedEnumerable<T>, as opposed to IEnumerable<T>?
For example, in theory, the Contains<T>() extension could potentially be optimized to use binary search when it is applied to ...
(The title for this question isn't the best, but I'm unsure how else to word it!)
I'm working on a search form which contains a checklist of values. Basically, a checked item means 'include this type in the search'. Something like this:
Search for item: __________
Search in:
[ ] Fresh Foods
[ ] Frozen Foods
[ ] Bevera...
I can't find a template for a linq to sql class in .net 2.0 project, based on what i know you can work with linq in .NET 2.0 as long as you have 3.5 in your development machine and ship system.core.dll with your application?
so based on that how can I add a Linq to Sql model to my project when "Linq to Sql Classes" template is missing ...
Hi guys,
I have a problem trying to do a couple of things with linq joins... currently I have a
group in linq that gives two columns, basically a count of tickets by location. Well now I'm trying to add a join that will join on the ticketID columns of two different tables Tickets and Comments.
I'm having a hell of a time trying to co...
Seems like this is the kind of thing that would have already been answered but I'm unable to find it.
My question is pretty simple, how can I do this in one statement so that instead of having to new the empty list and then aggregate in the next line, that I can have a single linq statement that outputs my final list. details is a list ...
How do I have LINQ to XML iqnore all namespaces? Or alteranately, how to I strip out the namespaces?
I'm asking because the namespaces are being set in a semi-random fashion and I'm tired of having to search for nodes both with and without a namespace.
...
What does it mean and why (if at all) is it important?
...
I've seem some projects out there and was wondering if anyone had any feedback.
The level of maturity of these projects seems low.
...
I am using Linq to SQL in my project. I have a part of the code that calls
DataContext db = new DataContext()
This works as expected when running the website however when calling this from within my unit test I get an error object not set to an instance...
Do you know why this is?
I know I should Mock the data context for testing bu...
I came across an interesting bug with linq to sql. Take a look at the code below which is loosely translated from a LINQtoSQL query from a search engine i'm writing.
The goal of the query is to find any groups which have the ID's "Joe", "Jeff", "Jim" in consecutive order.
Pay careful attention to the variables named localKeyword and l...
Is there a quick way to say
Where (data.x == (If notempty x = y else x = default))
Assuming the data being compared is both strings
Compare listitem.string with passed.string - if passed.string isnotempty, else passed.string equals default value.
in a Linq 'where` query.
Apologies that the question was really badly written.
... ...
I was pleasantly surprised a few months ago to learn that I could use many C# 3.x constructs (anonymous types, lambdas, automatic properties) in C#2.0, due to the fact that they all compile to the same IL...in effect, syntactic sugar.
Is this also the case of LINQ and XLINQ? Can i use these constructs while still targeting C#2.0 runtim...
Hello everyone I'm currently having 2 issues with the code below:
Upon return of result1 I'm trying to complete a check to see if it is != null and if it is't it will begin to delete the records selected. The issue is that even when result1 returns nothing and defaults the if statement doesn't pick this up so I guess I'm missing someth...
Hello I've currently got a program which retrieves WMI information and stores it to a database, after a certain period of time older records are then deleted. Currently I'm having my program delete records over 10 mintues old and it checks this every 2 mintues after populating the database with new information. In another timer which run...
Short question: does anyone have any information about what the memory performance of Linq is with large amounts of data? Specifically Linq to Datasets or Linq to Objects.
What is the largest number of records / objects it can handle? What is the memory overheads? Can anyone post some ballpark memory usage figures?
Background
My compa...
I have a VS2008 solution containing two projects, a web service (the actual work I'm doing) and a web application (that I'm using to test the service). The latter has a "web reference" to the former. It is also set as the startup project, so that when I start debugging VS sets up two ports on localhost, one for the app (which runs its de...
Not that I would want to use this practically (for many reasons) but out of strict curiousity I would like to know if there is a way to reverse order a string using LINQ and/or LAMBDA expressions in one line of code, without utilising any framework "Reverse" methods.
e.g.
string value = "reverse me";
string reversedValue = (....);
an...
I have a abstract Class where a Recipient either can be a EMailRecipient or a SMSRecipients.
Im selecting the data out in a List like List<Recipient>. For statistic reason i need to know then number of recipients based on the CountryCode in the SMSRecipient and i thought i could do that in linq. But i cant seem to cast a Recipient as a ...
I currently have a list that contains the following
CountryCode (string)
CountryStr (string)
RegionStr (string)
RegionID (int)
AreaStr (string)
AreaID (int)
This is a flattened set of linked data (so basically the results of a joined search that ive stored)
The MVC route will only pass one string which I then need to m...
I'm unable to convert this SQL query into a working linq statement
select sum(cena), id_auta, max(servis)
from dt_poruchy left outer join mt_auta on dt_poruchy.id_auta=mt_auta.id
where dt_poruchy.servis>=3 group by id_auta;
I tryed something like this but i cant handle the select statement
var auta = from a in MtAuta.FindAll()
...