Date post: | 15-Jan-2015 |
Category: |
Internet |
Upload: | gaines-kergosien |
View: | 2,272 times |
Download: | 1 times |
Build a MVC eCommerce Sitein Under 5 Minutes
Gaines Kergosien@gainesk
http://dotnetdude.net
Sr. Solutions Architecthttp://www.vanick.com
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
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
MVC
44
View
ModelController
MVC
55
View
ModelController
Models
Class that represents data
public class MyViewModel{ public string Foo { get; set; }}
Models
Validators
MVC
99
View
ModelController
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
Views
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
MVC
1313
View
ModelController
Controllers
Class derives from System.Web.Mvc.Controller
Generates the response to the browser requestpublic class HomeController : Controller{ public ActionResult Index() { ViewBag.Message = "Welcome to ASP.NET MVC!";
return View(); }
public ActionResult About() { return View(); }}
Controller Actions
Public method of the Controller class
Cannot be overloaded or a static methodpublic class HomeController : Controller
{ public ActionResult Index() { ViewBag.Message = "Welcome to ASP.NET MVC!";
return View(); }
public ActionResult About() { return View(); }}
Controllers
Controller Actions
Controllers
Controller Actions
Get
Post
Questions?
2020
View
ModelController
View
ModelBrowser Controller
MVC
2121
Routing
http://www.mysite.com/Home/About/6 {controller} = Home {action} = About {id} = 6
Locations for nopCommerce Nop.Web.Infrastructure.RouteProvider Nop.Web.Infrastructure.GenericUrlRoutePr
ovider
Route Provider
Generic URL Route Provider
nopCommerce Libraries Nop.Core – Domain Objects &
Infrastructure Nop.Data – Data Access
Uses Entity Framework Maps Tables to Domain Objects
Nop.Services – Business Logic
Domain Objects
Domain Objects
Domain Object Mapping
Services
Dependency Injection
Generic Repositories
LINQ Queries
nopCommerce Plugins Loaded at runtime
Independent of core source Consume events Marketable See next session!
nopCommerce Admin Site Nop.Admin project under relative
path /Admin Uses AutoMapper to link Objects
and Models
Contact Info
Blog: http://dotnetdude.net
Email: gaines [at] kergosien.net
Twitter: @gainesk
Rate this talk @ http://spkr8.com/t/35551