My LINQ Articles

I have been doing some LINQ/DLINQ articles over at codeproject.

Codeproject article link :LINQ Introduction 1 of 3

Heres a small taster of some of the LINQ standard query operators I discuss
in the article (the acticle does them all)

Where

var iSmall = 
    from it in _itemList 
    where it.UnitPrice < 50.00M 
    select it;

Select

 var namesAndPrices = 
     _itemList.Where(i => i.UnitPrice >= 10). 
Select(i => new { i.ItemName,i.UnitPrice }).ToList();

Take

var MostExpensive2 = _itemList. 
OrderByDescending(i => i.UnitPrice).Take(2);

Join

var itemOrders =    from i in _itemList 
join o in _orderList on i.ItemID equals o.OrderID 
select new { i.ItemName, o.OrderName };

GroupBy

var itemNamesByCategory =    from i in _itemList 
group i by i.Category into g 
select new { Category = g.Key, Items = g };

Intersect

var inter = (from i in _itemList select i.ItemID).Distinct() 
.Intersect((from o in _orderList select o.OrderID).Distinct());

ToArray

var query = _itemList.ToArray(). 
Where(i => i.Category.Equals"Food"));

Count

var foodCat = (from i in _itemList 
where i.Category.Equals("Food")  

select i).Count();

Sum

var totals = (from i in _itemList select i.UnitPrice).Sum();

Thats really only a few of the LINQ standard query operator, there are many many more
mentioned at the article link at the top of this section.

Ive also be doign some DLINQ stuff, and done an article about that as well.

Codeproject article link :DLINQ Introduction 2 of 3

This article discusses the use of the DLINQ designer, the enitity code file generation using the SQLMetal.exe tool,
and also shows some standard DLINQ queries and updates in action

I’ve even attracted the attention of a Mr Joe Rattz, who is just about to publish a LINQ book his blog is here LINQDev.com he liked my articles, as did the totally awesome Marc Clifton. So I must be something right. You decide.

Hope you like them

Advertisements

7 thoughts on “My LINQ Articles

  1. Hello Sacha,

    Nice articles. I have linked them from NetFxGuide. Let me know about others that you think could be listed or, if you prefer, I can give you access to a small admin system to add them by yourself.

    Best,

    Fran
    NetFxGuide.com

  2. sacha says:

    Thanks for that Fran. Im glad you like them.

    Ill let you know if theres more

  3. sacha says:

    Actually Francesco, I do have 2 more articles about WPF over at codeproject, they might also be of interest to you.

    See what you think

    Links are

    http://www.codeproject.com/useritems/DotNet_XAML.asp
    http://www.codeproject.com/useritems/WPF_CustomerControl.asp

    Thanks

  4. Mahsa says:

    Dear Sacha

    Hi
    i had a question and i couldnt find your email anywhere so i am leaving my message in the comment box.

    I read your article on SQL Database Image Storage & Easy Thumbnails and it really helped me out in my web application. It was one of the best articles I had come across in the code project web site. But I have a problem. My table has other field and now when I want to update those other fields an error accrues:” String or binary data would be truncated”

    I don’t know what to do with this error. I have tried all I knew but it hasn’t changed. What I can’t understand is that I am not updating the image_data field, only some other field that shouldn’t affect the image_data field.

    I would be very thankful if you help me out on this.

    Regards

    Mahsa

  5. Bob Ranck says:

    Sasha,

    I read your most recent WPF cropping component article.
    and i’m very interested in your work.

    Please send me an email direct to ranck@aqsi.net. I would like to discuss what I do and possible ways that you may be able to help.

    I’m located in the USA and all of my work is also in the USA but there is some possibility that you may be able to help.

    Bob Ranck

  6. skhan says:

    Hi,
    What good book(s) would you recomment for LINQ and XLINQ?

    Thanks

  7. sacha says:

    I have and love the Rattz one on Apress I got it after I already learnt LINQ, but its great.

    http://www.amazon.com/Pro-LINQ-Language-Integrated-Windows-Net/dp/1590597893/ref=cm_cr_pr_pb_i

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: