by Ira
26. August 2008 17:58
In a recent situation I was trying to pull some aggregates out of a DataTable using LINQ. I needed to get the rows of the DataTable with a Distinct clause, but my aggregates would be on other columns of the row. The problem is that when you call LINQ's Distinct() extension method with no arguments, it uses the "default IEqualityComparer". This means that it will work if you use the Select() extension method, only returning the column you want the distinct on. Well that works great, unless yo...
[More]
9eddbcd7-7533-4d6b-abb7-b316e3077e5b|1|4.0
Tags: c#, linq
C# | LINQ
by Ira
25. February 2008 18:07
Multi-Part Series
Custom Entity Classes Using LINQ to SQL Part 1 - DataObjects
Custom Entity Classes Using LINQ to SQL Part 2 - Data
Custom Entity Classes Using LINQ to SQL Part 3 - Queries
So in the first part of this series we made some DataObjects and used attributing from the System.Data.Linq.Mapping namespace to make our DataObjects LINQ visible. Then in the second part of this series we made LINQ aware of our child DataObjects along with created the actual data store and a custom DataCon...
[More]
by Ira
22. February 2008 19:16
Multi-Part Series
Custom Entity Classes Using LINQ to SQL Part 1 - DataObjects
Custom Entity Classes Using LINQ to SQL Part 2 - Data
Custom Entity Classes Using LINQ to SQL Part 3 - Queries
In my last post, Part 1 I showed the overview of how to set up your own entity classes or "DataObjects". This time, we are going to set up our inheritence mapping on the Animal class to inform LINQ that we have the child classes Penguin and Monkey. We already put the "Table" attribute on...
[More]
by Ira
21. February 2008 22:38
Multi-Part Series
Custom Entity Classes Using LINQ to SQL Part 1 - DataObjects
Custom Entity Classes Using LINQ to SQL Part 2 - Data
Custom Entity Classes Using LINQ to SQL Part 3 - Queries
Have you ever wanted to use the LINQ technology without being bound to the "LINQ to SQL Classes" item in Visual Studio? I know I have! I was wondering if there was a way to use LINQ, but doing it with my own DataObjects in either a ground up project or an add in scenario. It just so happens you ca...
[More]