Browse by Tags
All Tags »
Linq (
RSS)
We have all heard that Linq To Sql is dead. I even posted about it here: You Are The Weakest Linq, Goodbye! Stephen Forte , just posted another confirmation on our dead patient. So, what should you, me and hundreds more companies that are using Linq 2 Sql do? According to Stephen: So what should the Linq to SQL developer do? Throw it all away and learn EF? Use nHibernate? No. The Linq to SQL developer should continue to use Linq to SQL for the time being. If the next version of the EF is compelling...
I encountered a nice article by Eric White that explains how to debug Linq queries. Sum it up for me, please Basically, lets say that you have this complex query: var uniqueWords = text .Split( ' ' , '.' , ',' ) .Where(i => i != "" ) .Select(i => i.ToLower()) .GroupBy(i => i) .OrderByDescending(i => i.Count()) .Select(i => new { Word = i.Key, Count = i.Count() }) .Take(10); And, lets say you want to debug it, here is a trick that can help you do that...
Microsoft had released an Alpha 0.2 for supporting LINQ To XSD. The LINQ to XSD technology provides .NET developers with support for typed XML programming . LINQ to XSD contributes to the LINQ project (.NET Language Integrated Query). What does it look like? To get an idea, consider the following C#3.0 fragment for a LINQ to XML query that computes the total over the items in a XML tree for a purchase order: ( from item in purchaseOrder.Elements( "Item" ) select ( double )item.Element(...
Hi, Here is a little sample on how to merge two lists into a single list using Linq To Objects. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { class Person { public int Id { get ; set ; } public string Name { get ; set ; } } static void Main( string [] args) { List < Person > list = new List < Person >(); for ( int i = 0; i < 10000; i++) { list.Add( new Person { Id = i, Name = "guy" + i...
Extension methods is a new feature introduced by Orcas. As the name implies, the idea behind the extension method is to extend existing types with new methods. Getting Started Creating an extension method is fairly simple. For example, lets say that for each string type, you would like to add a new method that will convert white spaces into underscores: public static string SpaceToUnderscore( this string source) { char [] cArray = source.ToCharArray(); string result = null ; foreach ( char c in cArray...
DinnerNow is a fictious marketplace where customers can order food from local restaurants for delivery to their home or office. This sample is designed to demonstrate how you can develop a connected application using several new Microsoft technologies. The demo utilizes several technologies including: IIS7, ASP.NET Ajax Extensions, Linq, Windows Communication Foundation, Windows Workflow Foundation, Windows Presentation Foundation, Windows Powershell, and the .NET Compact Framework. You can download...