LINQPad – Cool Utility For LINQ

יום שבת, יוני 14, 2008

Maybe you know about this, but I saw it first few days a go. I officially in love. LINQPad is a cool little utility that was mainly created to allow you to test LINQ expressions and see them produce a  result and output the results in a nice easy to visualize format. It's great for running LINQ Queries without having to fire up Visual Studio. LINQPad is also a great way to learn LINQ: it comes preloaded with 200 examples from the book,"C# 3.0 in a Nutshell" written by Joseph Albahari, the author...
אין תגובות

Search The File System Using LINQ

יום שלישי, מאי 20, 2008

Do you want to search a file or file type in the file system? Nice way to do it is using LINQ. var files = from file in new DirectoryInfo(@"D:\temp").GetFiles() where file.Name == "MyFile.txt" select file; Or even search after specific file extension : var files = from file in new DirectoryInfo(@"D:\temp").GetFiles() where file.Extension == ".txt" ...
אין תגובות

Visual Studio 2008 and .NET Framework 3.5 Training Kit

יום שבת, מרץ 29, 2008

Microsoft released a nice training kit (~126MB) (it's a real treasure!) for the latest technologies. This package covers a bunch of technologies and includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including: Visual Studio Tools for Office Visual Studio Team System Application Lifecycle Management C# 3.0 VB 9.0 LINQ ...

LINQ in Action: Book Review

יום שבת, פברואר 16, 2008

Recently I got a copy of the book "LINQ in Action" (by Fabrice Marguerie, Steve Eichert, Jim Wooley, and Matt Warren (Foreword))from Manning publishing. Language Integrated Query (LINQ) is a great feature and I wrote about it in this blog. The book targets the .NET developers who know C# (2.0) or VB.NET (8.0): Whether you don't know LINQ or you already know - this book is for you. Read it! For me, it was a pleasure to read it: smooth, clear, didactic and effective. The book divided into 4 parts: Getting started, Querying objects...
3 תגובות

Pro LINQ: Language Integrated Query in C# 2008 – Early Review

יום ראשון, דצמבר 9, 2007

I like LINQ and I posted about it in my blog. In the last 2 weeks I have been reading the book Pro LINQ: Language Integrated Query in C# 2008  by Joseph C. Rattz, Jr.  | ISBN: 1-59059-789-3 which I have had access to via the Early Access Program as a PDF ebook. This book provides superb coverage of LINQ where it shows the reader how to leverage all the new LINQ C# 2008 language features including extension methods, lambda expressions, anonymous data types, and partial methods. The book refers to all kinds of LINQ...
2 תגובות

LINQBridge – Use LINQ to objects in .NET 2.0

יום שני, נובמבר 12, 2007

I really like LINQ, but what if I want to use it and the target framework is not .NET 3.5? There is a way to use LINQ to Objects in .NET 2.0 projects. LINQBridge makes this possible. I saw it today but I didn't try it yet. (I'll be soon) How it works? First, it's important to understand that C# 3.0 and Framework 3.5 are designed to work with CLR 2.0-the same CLR version that Framework 2.0 uses. This means that the C# 3.0 compiler emits IL code that runs on the same virtual machine as before. ...
תגיות: ,
אין תגובות

Linq to XML – Adding,Updating and Deleting data

יום שבת, אוקטובר 13, 2007

The previous post about Linq to XML introduced how to query XML data using LINQ. LINQ allows us to not only query XML in a truly unique way, but also create XML documents in a very expressive manner. This post will talk about other operations on the XML: adding, updating and deleting data. First, lets create a sample XML document: 1: XElement book = new XElement("Books", new XElement("Book", 2: new XAttribute("publisher", "O'Reilly Media, Inc."), 3: new XAttribute("price",...
3 תגובות

Query XML using XLINQ

יום ראשון, אוקטובר 7, 2007

LINQ to XML is a built-in LINQ data provider that is implemented within the System.Xml.Linq namespace in .NET 3.5. It enables us do the following to XML data: Read. Construct. Write. We can perform LINQ queries over XML from the file-system, from a remote HTTP URL or web-service, or from any in-memory XML content.LINQ to XML provides much richer (and easier) querying and data shaping support than the low-level XmlReader/XmlWriter API in .NET 2 and also much more efficient with usage of much less memory than the DOM API that XmlDocument provides. That's because it does not require you to...
תגובה אחת

Query types using LINQ

יום שני, אוקטובר 1, 2007

It's great. It's so beautiful. I really like it. Reflecting types using LINQ. How can we do it? We can use Reflection of course, but with LINQ it shortest and simplest. Declare "Type" object , assign the class you want to query and query with LINQ. Example 1: To get all methods of a class: 1: Type tPerson = typeof(Person); 2: var methods = from method in tPerson.GetMethods() 3: select method; 4:...
תגיות: , ,
תגובה אחת

Getting started with LINQ

יום שני, ספטמבר 24, 2007

Language Integrated Query (LINQ) introducing a standard set of operators that can be used to query several different data stores such as SQL Server and XML. LINQ comes as part of the future revisions of both the C# and VB.NET compilers (VS 2008). LINQ architecture As we see at the figure below, the data to be queried can take the form of XML (LINQ to XML), databases (LINQ-enabled ADO.NET, which includes LINQ to SQL, LINQ to Dataset and LINQ to Entities), objects (LINQ to Objects), and so on. (Click to enlarge every image) Each...
תגובה אחת