The new ASP.NET (part 1 of 7): Getting Started

I originally started blogging to keep track of code snippets and specific things that I thought I would forget in the future. Well, in the past several months I haven’t worked on any hardcore projects, so I haven’t had any hardcore blog posts. Now though, I have dug in and this next set of blog posts are going to pretty technical.

So, as we all know there are a few pieces of the .NET landscape that have changed in the last few years first with VS2008 + .NET 3.5, and then especially with VS2010 and .NET 4.0. I’ve dug into these new technologies and wanted to write about what I learned during the learning curve. How you might approach writing a website, has fundamentally changed, in 3 very different ways:

Entity Framework:
This is object-relational mapping (ORM) functionality that is built into .NET. It let’s you point to a database, and it generates a bunch of mapped data structures that represent your tables or stored procedures. Most importantly though is that it understands and respects foreign-key constraints, and let’s you access related tables through properties in your data structures. I’ll go into this in more detail, but for now just understand that it’s a very different, but extremely powerful way to interact with your underlying data in a strongly-typed way using collections of objects (like Customer and Order) instead of generic DataSets and DataTables of just “data”.

Linq and specifically Linq To Entities:
Language Integrated Query (Linq) is a new “language”, or set of commands you can use right inside of your favorite .NET language to query various objects that store data. I know that sounds a bit vague, but the point is that Linq can query from all sorts of objects. However, when you couple Linq with your Entity Framework setup – it makes interacting with your data structures that much easier. In fact, you will giggle at how powerful these features are – you can do so much with just a little clever coding.

MVC and MVVM:
Model View Controller (MVC) and Model View View-Model (MVVM) are fundamentally different ways to approach writing a web site. Instead of creating an .aspx page and putting content on it, there is a clear separation between routing a URL request (the controller), getting and massaging the data (Model and View-Model), and presenting on the screen (View). There is definitely a learning curve here, but after having used this for a bit – it really is better in every way.

In fact, I am nothing short of blown-away at how easy and powerfully these technologies work together. If you are brand new to these ideas, I am starting from scratch so this should be a good primer.

THE PROJECT:
For me to learn new things, I really do best if I have a practical project. In this case, I can always seem to turn to my brothers business! I originally wrote an MS Access database for them to keep track of quotes and orders and things, which they’ve been using. The database is proper and has referential integrity.

Well, we want to put that Access database into a SQL server, put a web front-end in front it, later support phone access to the website (having a phone-friendly version, I mean) – and then there may be some need to have a fat-client that talks over the internet to the database as well.

I feel I’m about 2/3 of the way through the learning curve, and a lot has already happened and a LOT has been learned. So, I wanted to stop development and write this stuff down before I forget. Here’s what I plan to do for blog posts, to explain how to get from Point A “I know regular ASP.NET and SQL” to Point B “I know EF, how to use Linq to query it, and how to use MVC to show it”:

Posted in .NET 4.0, ASP.NET, ASP.NET MVC, Entity Framework, Linq, Uncategorized
8 comments on “The new ASP.NET (part 1 of 7): Getting Started
  1. […] The new ASP.NET (part 2 of 7): Entity Framework and the database This is part of a series – see this post for explanation of the context: http://robseder.wordpress.com/2010/12/23/the-new-asp-net-part-1-of-7-getting-started/ […]

    Like

  2. […] The new ASP.NET (part 2 of 7): Entity Framework and the database This is part of a series – see this post for explanation of the context: http://robseder.wordpress.com/2010/12/23/the-new-asp-net-part-1-of-7-getting-started/ […]

    Like

  3. […] The new ASP.NET (part 3 of 7): Using Linq to query EF This is part of a series – see this post for explanation of the context: http://robseder.wordpress.com/2010/12/23/the-new-asp-net-part-1-of-7-getting-started/ […]

    Like

  4. […] The new ASP.NET (part 3 of 7): Using Linq to query EF This is part of a series – see this post for explanation of the context: http://robseder.wordpress.com/2010/12/23/the-new-asp-net-part-1-of-7-getting-started/ […]

    Like

  5. […] The new ASP.NET (part 4 of 7): MVC – web site setup This is part of a series – see this post for explanation of the context: http://robseder.wordpress.com/2010/12/23/the-new-asp-net-part-1-of-7-getting-started/ […]

    Like

  6. […] and generally makes the application easier and faster to write. So please, give them a chance. I am talking through the MVC stuff in this blog series. Here, I’ll try to cover the basics of […]

    Like

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

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 2 other followers

%d bloggers like this: