Posts

Showing posts from December, 2014

Easy Step to LINQ understand in C#

Linq queries for beginners Following are some of the basic Linq command/samples for those who just want to start learning Linq. So this will help a lot to all the beginners to easily understand Linq queries. // Basic Query // To achieve Select * From ProductMst you need to write follofing linq Query var Result1 = from p in db.ProductMst select p; // To achieve Select ProductID, ProductName, Price From ProductMst you need to write follofing linq Query var Result2 = from p in db.ProductMst select new { p.ProductID, p.ProductName, p.Price }; // Where Clause Query // To achieve Select * From ProductMst Where ProductID = 1 you need to write follofing linq Query var Result3 = from p in db.ProductMst where p.ProductID == 1 select p; // To achieve Select * From ProductMst Where SupplierId =2 and Price > 10 you need to write follofing linq Query var Result4 = from p in db.ProductMst where p.SupplierID == 2 && p.Price > 10 ...

The C# Station LINQ Tutorial

by Joe Mayo, 11/8/2011, 2/16/2013 Lesson 01: Introduction to LINQ This lesson provides essential concepts to learning Language Integrated Query (LINQ). It helps you get started and forms the basis for later lessons. Here are the objectives: Understand What LINQ Is. Learn What Problems LINQ Solves. Quickly See What LINQ Syntax Looks Like. Know Where LINQ can be Used. What is LINQ? LINQ is an acronym for Language Integrated Query, which is descriptive for where it's used and what it does. The  Language Integrated  part means that LINQ is part of programming language syntax. In particular, both C# and VB are languages that ship with .NET and have LINQ capabilities. Another programming language that supports LINQ is Delphi Prism. The other part of the definition,  Query , explains what LINQ does; LINQ is used for querying data. Notice that I used the generic term "data" and didn't indicate what type of data. That's because LINQ can be used to query man...

ASP.NET MVC Web App on 3-Tier for Beginners – Part 2

Image
Introduction This article is the continuation of  Part 1 . In the first article, we saw understanding of requirements and then breaking them into objects, then finding out the relationships among them and finally designing and implementing the database. Now, let us see how to create a solution, then add multiple projects to it and then add desired references to the respective projects. 2: Analysis and Design (Creating Solution and Projects) Create a new project in Visual Studio as  LinkHubUI , choose desired path and click OK. Select Empty project, check the MVC check box and click on OK. Now, we will add some list of tasks which will make us implement the project easily. We will add a text file, right click on project, add Add New Item and name it as  ToDoList.txt . This  ToDoList  contains the list of tasks that we need to perform. This is a step-by-step process to implement the layered architecture in MVC. I’ve done a little hard wor...

Beginner's Guide for Designing ASP.NET MVC Applications using SQL Server and Entity Framework

Image
In this article we will discuss how to Design ASP.NET MVC Applications using SqlServer and Entity Framework Introduction In this article we will discuss how to design ASP.NET MVC applications using SQL Server and Entity Framework. Background Last weekend I got a chance to visit one of my friend's workplace. These guys wanted some unofficial help on starting up a new project. Their company has been developing Web Forms based applications since many years. Now they wanted to switch to ASP.NET MVC for new projects. Everybody in the organization was pretty excited and studying ASP.NET MVC. But they had some concerns on how to kick start their project with this new technology. How should concerns like n-tier architecture, data access, and unit testing be planned and implemented. I spent almost a day with them and most of it was in front of the white board with a projector showing diagrams and texts of the ASP.NET MVC architecture. At the end of the day we came up with a plan ...

An Absolute Beginner's Tutorial on ASP.NET MVC for Web Forms Developers

Image
Download sample - 1.3 MB Introduction In this article we will try to look at ASP.NET MVC architecture from a beginner's perspective. There are a plethora of articles available on the same topic. This article is yet another attempt of explain MVC in my own words. Background  ASP.NET MVC is the architectural pattern based on ASP.NET framework which provides a clean and elegant way of developing Web application. Before we can understand why MVC is in vogue we need to understand some limitation of Web forms first. A Brief Discussion on Web Forms let us discuss some limitation of web forms which are seen as drawbacks. I am sure many veteran developers will agree that these drawbacks can be put in check by following best practices and guidelines but none the less its a good idea to discuss them before looking at the ASP.NET MVC architecture. ViewState : This is the heart of ASP.NET when it comes to the ability of ASP.NET to provide stateful ...