Generic Collections in C# Generic collections were introduced in the .NET Framework 2.0. They provide a type safe approach for working with collections in .NET. The later versions added querying capabilities to these generic collections what we know as LINQ queries. There are two primary interfaces that every generic collection actually implements. They are the IEnumerable<T> interface and IQueryable<T> interface....
Author: Joydip Kanjilal
Exploring LINQ to DataSets
Exploring LINQ to DataSets DataSets are in-memory representations of data. In this article, we will explore the following: Understanding Typed and UnTyped DataSets Populating a Typed DataSeta Working with LINQ to DataSet Retrieving changes made to the DataSet Working with Typed DataSets using LINQ to DataSet Pre-requisites Note that to work with the code examples given in this article, you...
Working with Operators in LINQ – Part 2
Working with Operators in LINQ – Part 2 Element Operators Element operators allow you to retrieve elements from a sequence at specific locations. First The First operator returns the first element in a sequence. AdventureWorksDataContext adc = new AdventureWorksDataContext(); Product query = adc.Products.AsEnumerable().First(); Console.WriteLine(String.Format("ID = {0},tName = {1}",query.ProductID,query.Name)); The example below uses a predicate in the First operator. AdventureWorksDataContext adc...
Working with Operators in LINQ – Part 1
Working with Operators in LINQ – Part 1 In this series of articles we will discuss on operators in LINQ. In this part we will explore the aggregation operators and conversion operators. Aggregation Operators Count Count operator counts the number of elements in the sequence. A check is being performed if the source of type T implements the ICollection<T> interface...
The LINQ to SQL Data Model – Part 2
Create operation using LINQ to SQL Open VisualStudio.NET and create a new ASP.NET WebApplication. From the main menu click Project > Add New Item, click on the Web Form item. Change the name of the web form to Create.aspx. From the main menu click Project > Add New Item, click on the Web Form item. Change the name of the...
The LINQ to SQL Data Model – Part 1
The LINQ to SQL Data Model – Part 1 LINQ to SQL is a technology that allows you to create an object relational mapping between the tables in your relational database to objects. You can imagine LINQ to SQL as an object mapping tool that makes easier for developers to develop data centric applications using Microsoft SQL Server. It basically...
New features and enhancements in Visual Studio 2013
New Features and Enhancements in Visual Studio 2013 You asked and Microsoft responded. And, responded with a bang! Confused in these twist of sentences? Relax! Microsoft has just come up with the Preview Release of the latest version of its world class development environment. Yes! It’s Visual Studio 2013. There have been many new advancements (new features and extended features...
Working with PEX Framework
Working with PEX Framework Microsoft’s PEX Framework is an automated white box testing tool that can be integrated with Visual Studio. It has been developed by Microsoft research team and generates test suites with high code coverage. It can investigate and explore the managed code and suggest the tests which a particular test requires. PEX framework from Microsoft provides support...
Working with Parallel LINQ
This article reflects on parallel programming concepts, PLINQ, discusses the new features and enhancement to the Parallel Extensions Library, and reflects on how to implement declarative data parallelism in your applications using PLINQ. It also discusses the tips and techniques to better leverage the benefits of PLINQ. Single and Multi-threaded Applications Applications are either single threaded or multi-threaded. In a...
Working with OData Protocol
With the rise in the availability of data, it is extremely important that we keep our data in a structured format as much as possible. Whether we choose to work on a mainframe, a mini, a server farm or a PC, a standardized API for dealing with the data in a structured format is needed. If the data is relational,...