Skip to content


Subversion checkout URL

You can clone with
Download ZIP
100644 51 lines (36 sloc) 2.96 KB
bf0ae70 Added README - we need a nice ignore file too
unknown authored
1 ASP.NET MVC Music Store, Updated
2 ===================================
3 This repo started life as a way to do a Tekpub episode and contribute back to an Open Source project in the meantime.
4 What you see in this repo is our effort to "clean up" a few things, pull this project into the modern day, and add some
5 light functionality.
7 This is described below.
9 ##Twitter Bootstrap
10 The CSS for the project was fine, but there are things every web site needs and Twitter Bootstrap can really help with that.
11 We've added that to every page, while trying to keep the look and feel the same.
13 ##Industry Standard Structure
14 The original project works fine, but doesn't really follow the Controller/Action naming standards used by Rails and followed
15 by many other frameworks - including ASP.NET MVC itself! So we cleaned up the controllers to reflect the common ideas used
16 in the industry.
18 ##Better Use Of EntityFramework
19 One mistake that people getting used to EntityFramework will make is "flushing" the data context (aka calling "SaveChanges") whenever they
20 want to see a model change. This is a **very bad idea** because the DataContext is a UnitOfWork - meaning that other models at other
21 points in the application might have queued changes, waiting for other models to change as well.
23 The only point you should SaveChanges() is the last possible moment. Which is usually at the very end of the request.
25 For that reason we've included a Controller Base Class called "DbController". You could also use Inversion of Control for this, but (as pointed out below)
26 this demo app doesn't use it, and we want to comply with the ASP.NET Team's wishes.
28 Have a look at how you can open a session, make it available to your models, and then save the changes later on - disposing when all is said and done.
30 ##KnockoutJS
31 The whole point of this exercise is to show off KnockoutJS. Over the coming week we'll be augmenting some of the site functionality
32 to use Knockout effectively. What does "effectively" mean? It means "not just because" - we want to use it where it will **greatly improve the user experience**.
34 You can follow what we do in the Order/Edit bits.
36 ##Helpers
37 We've added a few helpers to work with Bootstrap as well as get around some of the amazing craziness in the HTML Helpers. You can find
38 our additions in the App_Code directory.
40 ##Code Templates
41 We've rewritten the core code templates to use Bootstrap, adding some nice eye-candy and confirmations on delete.
43 ##Help?
44 If you want to help - feel free! We won't be accepting **any Resharper Forks** - so please don't request a pull if you've "run Resharper for us".
45 However, we'd love any contribution that fixes a bug or enhances the project overall.
47 This site is meant to be a super-beginner demonstration of process and concept. There's no IoC and the overall "concept count" is kept to a minimum.
48 This isn't our choice - but we're honoring what the ASP.NET Team wants to do here.
50 Hopefully some of the ideas you see here might work their way back to the origin demo.
Something went wrong with that request. Please try again.