Your SlideShare is downloading. ×
  • Like
Building a MVC eCommerce Site in Under 5 Minutes
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Building a MVC eCommerce Site in Under 5 Minutes

  • 2,537 views
Published

For those of us who have spent most of our careers building business applications, the prospect of creating an e-commerce storefront can be quite daunting. Not only do you have to deal with …

For those of us who have spent most of our careers building business applications, the prospect of creating an e-commerce storefront can be quite daunting. Not only do you have to deal with calculating tax, estimating shipping and accepting payments, but employees need a way to manage products, discounts and marketing content. Thankfully, there's an open source e-commerce solution written in Microsoft ASP.NET MVC named nopCommerce that provides all this functionality and much more. I was so impressed by both the functionality and the underlying architecture that I've created a presentation which I believe will serve as a great introduction to MVC as well as a tutorial on developing custom storefronts using nopCommerce. We start off with a brief overview of basic MVC concepts accompanied by examples within the nopCommerce code. This includes strongly typed Razor views, HTML helpers, jQuery ajax calls, and fluent validation. Once everyone understands how the website works, we dive into the infrastructure by introducing WCF services, using a generic repository with Entity Framework(EF4) and LINQ, as well as Dependency Injection (DI) with Automapper.

Published in Internet , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
2,537
On SlideShare
0
From Embeds
0
Number of Embeds
4

Actions

Shares
Downloads
57
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Uses fluent validation attribute to add validator class
  • Uses fluent validation attribute to add validator class

Transcript

  • 1. Build a MVC eCommerce Site in Under 5 Minutes Gaines Kergosien @gainesk http://dotnetdude.net Sr. Solutions Architect http://www.vanick.com
  • 2. 2 What is nopCommerce?  Open Source  Product Catalog  Categories  Products/Variants  Customer Management  Order Management  Mobile Support  Discounts  Wish Lists  Gift Cards  Newsletters  Recurring Payments  Reporting  Payment Methods  Shipping Methods  Taxes  External Auth  Polls  News  Blogs  Forums  Multiple Stores
  • 3. Why this topic? 3  Why MVC and WCF?  Decoupled  Scalable  Reusable  Maintainable  Why nopCommerce?  Top eCommerce app on MS Web Matrix  Open Source (GPLv2 License) 3
  • 4. MVC 4 4 View ModelController
  • 5. MVC 5 5 View ModelController
  • 6. Models  Class that represents data public class MyViewModel { public string Foo { get; set; } }
  • 7. Models
  • 8. Validators
  • 9. MVC 9 9 View ModelController
  • 10. Views  A view is a standard (X)HTML document that can contain scripts.  Views support ASP.NET markup or Razor  Razor markup used in nopCommerce  nopCommerce views are strongly typed
  • 11. Views
  • 12. HTML Helpers  Methods which typically return string.  Used to generate standard HTML elements  textboxes, dropdown lists, links etc.  Usage is optional  You can create your own HTML Helpers
  • 13. MVC 13 13 View ModelController
  • 14. Controllers  Class derives from System.Web.Mvc.Controller  Generates the response to the browser request public class HomeController : Controller { public ActionResult Index() { ViewBag.Message = "Welcome to ASP.NET MVC!"; return View(); } public ActionResult About() { return View(); } }
  • 15. Controller Actions  Public method of the Controller class  Cannot be overloaded or a static method public class HomeController : Controller { public ActionResult Index() { ViewBag.Message = "Welcome to ASP.NET MVC!"; return View(); } public ActionResult About() { return View(); } }
  • 16. Controllers
  • 17. Controller Actions
  • 18. Controllers
  • 19. Controller Actions  Get  Post
  • 20. Questions? 20 20 View ModelController
  • 21. View ModelBrowser Controller MVC 21 21
  • 22. Routing http://www.mysite.com/Home/About/6 {controller} = Home {action} = About {id} = 6  Locations for nopCommerce  Nop.Web.Infrastructure.RouteProvider  Nop.Web.Infrastructure.GenericUrlRouteProvider
  • 23. Route Provider
  • 24. Generic URL Route Provider
  • 25. nopCommerce Libraries  Nop.Core – Domain Objects & Infrastructure  Nop.Data – Data Access  Uses Entity Framework  Maps Tables to Domain Objects  Nop.Services – Business Logic
  • 26. Domain Objects
  • 27. Domain Objects
  • 28. Domain Object Mapping
  • 29. Services
  • 30. Dependency Injection
  • 31. Generic Repositories
  • 32. LINQ Queries
  • 33. nopCommerce Plugins  Loaded at runtime  Independent of core source  Consume events  Marketable  See next session!
  • 34. nopCommerce Admin Site  Nop.Admin project under relative path /Admin  Uses AutoMapper to link Objects and Models
  • 35. Contact Info Blog: http://dotnetdude.net Email: gaines [at] kergosien.net Twitter: @gainesk Rate this talk @ http://spkr8.com/t/35551