Musings of a .NET Developer

October 9, 2008

Starting to LINQ

Filed under: LINQ — smakazmi @ 11:45 am

Hello and welcome to the first in a series of posts in which I’ll be exploring LINQ.
As I’ve previously mentioned that these posts are made so that I and other people visiting this blog can refer to them quickly in time of need, I’ll try to keep the posts as clear and concise as possible.

Introduction

LINQ (short for Language INtegrated Query) is an extension to .NET languages. It allows us developers to query different sources of data.

Why do we need it?

In enterprise application development, we frequently face the need to query data. The data could be present in

  • CSV
  • XML
  • .NET Collections
  • SQL Server, Oracle, MySQL, PostgreSQL and the list goes on

For each of these data sources we need to resort to a querying API that is specific to the data source. For example XPath, XQuery, T-SQL, PL/SQL

LINQ aims to facilitate .NET developers by providing a querying API that is baked right into our favorite programming languages (i.e. C#, VB etc.) and can be extended to provide querying support to any data source. This provides a number of benefits:

  • Reduced learning curve
  • Reduced training costs
  • Reduced risk due to type checking at compile time
  • Less amount of rework in case of switching back-end data source

LINQ can be extended by using a provider pattern. Currently the following providers are available out of the box.

  • LINQ to SQL
  • LINQ to DataSet
  • LINQ to Objects
  • LINQ to Xml
  • LINQ to Entities

We’ll have a look at each of these individually in forthcoming posts.

How to LINQ?

Using LINQ effectively requires us to learn some other new features that LINQ is built upon and that are also introduced in .NET 3.0. These include:

  • Anonymous types
  • Lambdas
  • Object Initializer
  • Extension Methods

In the next post I’ll cover these features and we’ll further explore LINQ in the following posts.

Bye for now

October 7, 2008

Welcome

Filed under: Uncategorized — smakazmi @ 6:15 pm

Welcome to my blog. In this first post of mine I’ll try to introduce myself as briefly as possible.
I’ll emphasize more on ‘Why I want to blog?’. So let’s get started.

I am Software Engineer. I live and work in Karachi, PK. I am always very eager to learn and to experiment with new and upcoming technologies.
.NET is my development platform of choice for the simple reason that it’s so easy to get started with it.

Coming to why I all of a sudden decided to blog. Well for quite some time now, I’ve been trying to learn new .NET technologies such as LINQ,
WCF, WF, WPF, but I rarely find the time to pursue this. When I do get time, I learn something and then forget it over time. I am starting
this blog in order to document what I learn. I believe that this will prove to be a more effective learning methodology. I also hope that other
people will be able to benefit from my posts as well as constructively comment on them so that over time this blog can turn into a useful
learning resource.

So that’s all for now. I think I’ll be exploring LINQ in the next series of posts so stay tuned.

Bye Bye

Create a free website or blog at WordPress.com.