¡@

Home 

c# Programming Glossary: linq

LINQ query on a DataTable

http://stackoverflow.com/questions/10855/linq-query-on-a-datatable

query on a DataTable I'm trying to perform a LINQ query on.. query on a DataTable I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that.. how to get something like this working I'm amazed that LINQ queries are not allowed on DataTables c# .net linq .net 3.5..

Returning IEnumerable<T> vs IQueryable<T>

http://stackoverflow.com/questions/2876616/returning-ienumerablet-vs-iqueryablet

is that IQueryable T is the interface that allows LINQ to SQL LINQ. to anything really to work. So if you further refine.. that IQueryable T is the interface that allows LINQ to SQL LINQ. to anything really to work. So if you further refine your query.. if possible. For the IEnumerable T case it will be LINQ to object meaning that all objects matching the original query..

Parsing JSON using Json.net

http://stackoverflow.com/questions/401756/parsing-json-using-json-net

usage for it. It seems like serializing first then using LINQ with my object would be ideal and every example I find discusses..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

LINQ OrderBy on IEnumerable T I found an example in the VS2008 Examples.. T I found an example in the VS2008 Examples for Dynamic LINQ that allows you to use a sql like string e.g. OrderBy Name Age.. stumbled into this oldie... To do this without the dynamic LINQ library you just need the code as below. This covers most common..

Split List into Sublists with LINQ

http://stackoverflow.com/questions/419019/split-list-into-sublists-with-linq

List into Sublists with LINQ I believe this is another easy one for you LINQ masters out.. with LINQ I believe this is another easy one for you LINQ masters out there. Is there any way I can separe a List into..

How would you count occurrences of a string within a string?

http://stackoverflow.com/questions/541954/how-would-you-count-occurrences-of-a-string-within-a-string

you're using .NET 3.5 you can do this in a one liner with LINQ int count source.Count f f ' ' If you don't want to use LINQ.. int count source.Count f f ' ' If you don't want to use LINQ you can do it with int count source.Split ' ' .Length 1 You..

How does one parse XML files? [closed]

http://stackoverflow.com/questions/55828/how-does-one-parse-xml-files

LINQ to read XML

http://stackoverflow.com/questions/670563/linq-to-read-xml

to read XML I got this XML file root level1 name A level2 name.. level1 name C root Could someone give me a C# code using LINQ the simplest way to print this result Note the extra space if..

Is it possible to dynamically compile and execute C# code fragments?

http://stackoverflow.com/questions/826398/is-it-possible-to-dynamically-compile-and-execute-c-sharp-code-fragments

nice short example take from LukeH's blog which uses some LINQ too just for fun. using System using System.Collections.Generic..

Problem with converting int to string in Linq to entities

http://stackoverflow.com/questions/1066760/problem-with-converting-int-to-string-in-linq-to-entities

Throws exception ToString is not supported in linq to entities. Text c.Name Is there anyway I can achieve this.. im unable to get used to C#'s strictness c# asp.net linq to entities tostring share improve this question With EF..

LINQ query on a DataTable

http://stackoverflow.com/questions/10855/linq-query-on-a-datatable

that LINQ queries are not allowed on DataTables c# .net linq .net 3.5 share improve this question You can't query against..

Preserving order with LINQ

http://stackoverflow.com/questions/204505/preserving-order-with-linq

be sure the order of the array is not changed c# arrays linq data structures order share improve this question I examined..

LINQ - Fluent and Query Expression - Is there any benefit(s) of one over other? [closed]

http://stackoverflow.com/questions/214500/linq-fluent-and-query-expression-is-there-any-benefits-of-one-over-other

or is there any particular benefit of one over other c# linq share improve this question Neither is better they serve..

Returning IEnumerable<T> vs IQueryable<T>

http://stackoverflow.com/questions/2876616/returning-ienumerablet-vs-iqueryablet

execution When should one be preferred over the other c# linq linq to sql ienumerable iqueryable share improve this question.. When should one be preferred over the other c# linq linq to sql ienumerable iqueryable share improve this question..

When should I dispose of a data context

http://stackoverflow.com/questions/389822/when-should-i-dispose-of-a-data-context

an application. The access layer makes extensive use of linq classes to return data. Currently in order to reflect data back.. a new data context every time i want to visit the db c# linq linq to sql share improve this question It actually doesn't.. data context every time i want to visit the db c# linq linq to sql share improve this question It actually doesn't matter..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

any way to get this functionality on IEnumerable T c# linq linq to objects share improve this question Just stumbled.. way to get this functionality on IEnumerable T c# linq linq to objects share improve this question Just stumbled into..

Split List into Sublists with LINQ

http://stackoverflow.com/questions/419019/split-list-into-sublists-with-linq

to be a parameter of this function. Is it possible c# linq data structures share improve this question Try the following..

Linq Distinct on a particular Property

http://stackoverflow.com/questions/489258/linq-distinct-on-a-particular-property

Person depending of some of its Properties in .Net 3.5 c# linq .net 3.5 share improve this question EDIT This is now part..

LINQ to SQL: Return anonymous type?

http://stackoverflow.com/questions/534690/linq-to-sql-return-anonymous-type

is there another easier way Thanks in advance. c# asp.net linq linq to sql share improve this question I tend to go for.. another easier way Thanks in advance. c# asp.net linq linq to sql share improve this question I tend to go for this..

Random row from Linq to Sql

http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql

I have a condition e.g. some field must be true c# .net linq to sql share improve this question You can do this at the..

LINQ to read XML

http://stackoverflow.com/questions/670563/linq-to-read-xml

lv1 var lv2s from lv2 in xdoc... c# xml linq linq to xml share improve this question Try this. Load xml.. lv1 var lv2s from lv2 in xdoc... c# xml linq linq to xml share improve this question Try this. Load xml XDocument..

Retrieving Property name from lambda expression

http://stackoverflow.com/questions/671968/retrieving-property-name-from-lambda-expression

throw new ArgumentException method return memberExpr c# linq lambda expression trees share improve this question I recently..

Problem with converting int to string in Linq to entities

http://stackoverflow.com/questions/1066760/problem-with-converting-int-to-string-in-linq-to-entities

with converting int to string in Linq to entities var items from c in contacts select new ListItem..

How can I easily convert DataReader to List<T>? [duplicate]

http://stackoverflow.com/questions/1464883/how-can-i-easily-convert-datareader-to-listt

or fields to maps DataReaders to objects. A bit like what LinqToSql does. They save a bit of typing and may reduce the number.. to you are likely to be better of using NHibernate EF or Linq to Sql etc However on old project or for other sometimes valid..

Performance surprise with “as” and nullable types

http://stackoverflow.com/questions/1583050/performance-surprise-with-as-and-nullable-types

Code using System using System.Diagnostics using System.Linq class Test const int Size 30000000 static void Main object.. 1 FindSumWithCast values FindSumWithAs values FindSumWithLinq values static void FindSumWithCast object values Stopwatch.. 1 sum long sw.ElapsedMilliseconds static void FindSumWithLinq object values Stopwatch sw Stopwatch.StartNew int sum values.OfType..

How would you do a “not in” query with Linq?

http://stackoverflow.com/questions/183791/how-would-you-do-a-not-in-query-with-linq

would you do a &ldquo not in&rdquo query with Linq I have 2 collections which have an Email property in both collections... would just use not in but I do not know the equivalent in Linq. How is that done So far I have a join like... var matches from..

Use Linq to Xml with Xml namespaces

http://stackoverflow.com/questions/2340411/use-linq-to-xml-with-xml-namespaces

Linq to Xml with Xml namespaces I have this code string theXml @.. with the second one I have good values ... How to use Linq to Xml with xmlns values c# linq to xml xml namespaces share..

delegate keyword vs. lambda notation [duplicate]

http://stackoverflow.com/questions/299703/delegate-keyword-vs-lambda-notation

delegate. Edit Here's some links for Expressions. System.Linq.Expression.Expression TDelegate start here . Linq in memory.. System.Linq.Expression.Expression TDelegate start here . Linq in memory with delegates such as System.Func uses System.Linq.Enumerable.. in memory with delegates such as System.Func uses System.Linq.Enumerable . Linq to SQL and anything else with expressions..

C#.NET :How to Sort a List <T> by a property in the object

http://stackoverflow.com/questions/3309188/c-net-how-to-sort-a-list-t-by-a-property-in-the-object

this question The easiest way I can think of it to use Linq List Order SortedList objListOrder.OrderBy o o.OrderDate .ToList..

Linq Distinct on a particular Property

http://stackoverflow.com/questions/489258/linq-distinct-on-a-particular-property

Distinct on a particular Property I am playing with Linq to.. Distinct on a particular Property I am playing with Linq to learn about it but I can't figure out how to Distinct when.. and Person3 Is that possible If it's not possible with Linq what would be the best way to have a list of Person depending..

LINQ to SQL: Return anonymous type?

http://stackoverflow.com/questions/534690/linq-to-sql-return-anonymous-type

the best way to return results from multiple tables using Linq to Sql Say I have two tables Dogs Name Age BreedId Breeds BreedId..

All possible C# array initialization syntaxes

http://stackoverflow.com/questions/5678216/all-possible-c-sharp-array-initialization-syntaxes

other techniques of obtaining arrays exist such as the Linq ToArray extensions on IEnumerable T . Also note that in the..

Random row from Linq to Sql

http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql

row from Linq to Sql What is the best and fastest way to retreive a random.. is the best and fastest way to retreive a random row using Linq to SQL when I have a condition e.g. some field must be true..

Get installed applications in a system

http://stackoverflow.com/questions/908850/get-installed-applications-in-a-system

Aside from the example below you can find a version using Linq here and a similar version to what I've done here . This is..