about 1 year ago - No comments
Have you wondered if and when you should use the new LINQ features in .Net 3.5?
Like, where should I put a new extension method? Should I use Func<T> or a custom delegate? How do I best implement a mix-in (extension methods on an interface)?
Well, Mircea Trofin has just published a new draft of some LINQ [...]
about 2 years ago - 25 comments
When learning LINQ-to-SQL, it’s not immediately obvious how to do an update. Querying is easy, and there are methods for inserting and deleting. Updating usually occurs by modifying an object already known to the DataContext and then calling SubmitChanges on the context.
var product = (from p in dataContext.Products
[...]
about 2 years ago - No comments
Quick tip: If you want to see the SQL generated by LINQ to SQL for a query or command, simply set the Log property of your generated DataContext class to an instance of a TextReader.
If this is your code:
using System;
using System.Linq;
using System.Data.Linq;
namespace LINQtoSQLConsole {
class Program {
static void Main(string[] args) [...]
about 2 years ago - 9 comments
When you started using LINQ, did you think it looked like SQL? I did.
The more I learned LINQ, the more I realized it wasn’t anything like SQL. Take grouping, for example. Because LINQ has a group by statement, and it looks like SQL, I assumed that the syntax for grouping in LINQ would be just [...]
about 2 years ago - 5 comments
I am really getting into LINQ now! I think it’s fantastic. I recently wanted to develop a quick drop-down list in ASP.Net which allows a user to select a time of day from a list. The times are 15 minutes apart, so the list would look like this:
… 08:00 08:15 08:30 08:45 09:00 …
… and [...]
about 2 years ago
Nice chapter! Now I am just wondering how LINQ actually queries the DataSet. Is the expression tree translated into something that will use the same mechanics as e.g. a DataView’s filter? Are there any performance differences in querying via DatView or via LINQ, or is it all the same…
about 2 years ago
You’re welcome
It looks like you can’t link directly to the PDF. The link to the PDF can be found directly on the book homepage: http://www.manning.com/marguerie/
Thanks
about 2 years ago
Frank, Linq to Datasets just uses LINQ to Objects to query them in memory datasets. You may find better performance with a dataView in some cases. LINQ to Datasets gives you additional functionality in terms of complexity, joins, aggregation, set operations that you don’t get otherwise with the standard dataset implementations.