8 | Thank you for confirming your account. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
9 |
10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
11 |
There are no external authentication services configured. See this article
13 | for details on setting up this ASP.NET application to support logging in via external services.
@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })
20 |
@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/MVCMusicStore/MVCMusicStore/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
4 |
--------------------------------------------------------------------------------
/MVCMusicStore/MVCMusicStore/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/MVCMusicStore/MVCMusicStore/favicon.ico
--------------------------------------------------------------------------------
/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Module 1 - Basics of MVC/readme.txt:
--------------------------------------------------------------------------------
1 | (no code for this session)
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore.Tests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore.Tests/Controllers/HomeControllerTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Web.Mvc;
6 | using Microsoft.VisualStudio.TestTools.UnitTesting;
7 | using MVCMusicStore;
8 | using MVCMusicStore.Controllers;
9 |
10 | namespace MVCMusicStore.Tests.Controllers
11 | {
12 | [TestClass]
13 | public class HomeControllerTest
14 | {
15 | [TestMethod]
16 | public void Index()
17 | {
18 | // Arrange
19 | HomeController controller = new HomeController();
20 |
21 | // Act
22 | ViewResult result = controller.Index() as ViewResult;
23 |
24 | // Assert
25 | Assert.IsNotNull(result);
26 | }
27 |
28 | [TestMethod]
29 | public void About()
30 | {
31 | // Arrange
32 | HomeController controller = new HomeController();
33 |
34 | // Act
35 | ViewResult result = controller.About() as ViewResult;
36 |
37 | // Assert
38 | Assert.AreEqual("Your application description page.", result.ViewBag.Message);
39 | }
40 |
41 | [TestMethod]
42 | public void Contact()
43 | {
44 | // Arrange
45 | HomeController controller = new HomeController();
46 |
47 | // Act
48 | ViewResult result = controller.Contact() as ViewResult;
49 |
50 | // Assert
51 | Assert.IsNotNull(result);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/App_Start/FilterConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web;
2 | using System.Web.Mvc;
3 |
4 | namespace MVCMusicStore
5 | {
6 | public class FilterConfig
7 | {
8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9 | {
10 | filters.Add(new HandleErrorAttribute());
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/App_Start/RouteConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Routing;
7 |
8 | namespace MVCMusicStore
9 | {
10 | public class RouteConfig
11 | {
12 | public static void RegisterRoutes(RouteCollection routes)
13 | {
14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15 |
16 | routes.MapRoute(
17 | name: "Default",
18 | url: "{controller}/{action}/{id}",
19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
20 | );
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Content/Site.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 50px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | /* Set padding to keep content from hitting the edges */
7 | .body-content {
8 | padding-left: 15px;
9 | padding-right: 15px;
10 | }
11 |
12 | /* Set width on the form input elements since they're 100% wide by default */
13 | input,
14 | select,
15 | textarea {
16 | max-width: 280px;
17 | }
18 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 |
7 | namespace MVCMusicStore.Controllers
8 | {
9 | public class HomeController : Controller
10 | {
11 | public ActionResult Index()
12 | {
13 | return View();
14 | }
15 |
16 | public ActionResult About()
17 | {
18 | ViewBag.Message = "Your application description page.";
19 |
20 | return View();
21 | }
22 |
23 | public ActionResult Contact()
24 | {
25 | ViewBag.Message = "Your contact page.";
26 |
27 | return View();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MVCMusicStore.MvcApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Optimization;
7 | using System.Web.Routing;
8 |
9 | namespace MVCMusicStore
10 | {
11 | public class MvcApplication : System.Web.HttpApplication
12 | {
13 | protected void Application_Start()
14 | {
15 | AreaRegistration.RegisterAllAreas();
16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
17 | RouteConfig.RegisterRoutes(RouteTable.Routes);
18 | BundleConfig.RegisterBundles(BundleTable.Bundles);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Models/Album.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Album
9 | {
10 | public int AlbumID { get; set; }
11 |
12 | public string Title { get; set; }
13 |
14 | public Artist Artist { get; set; }
15 |
16 | public virtual List Review { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Models/Artist.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Artist
9 | {
10 | public int ArtistID { get; set; }
11 |
12 | public string Name { get; set; }
13 |
14 | public virtual List Albums { get; set; }
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Models/IdentityModels.cs:
--------------------------------------------------------------------------------
1 | using System.Security.Claims;
2 | using System.Threading.Tasks;
3 | using Microsoft.AspNet.Identity;
4 | using Microsoft.AspNet.Identity.EntityFramework;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
9 | public class ApplicationUser : IdentityUser
10 | {
11 | public async Task GenerateUserIdentityAsync(UserManager manager)
12 | {
13 | // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
14 | var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
15 | // Add custom user claims here
16 | return userIdentity;
17 | }
18 | }
19 |
20 | public class ApplicationDbContext : IdentityDbContext
21 | {
22 | public ApplicationDbContext()
23 | : base("DefaultConnection", throwIfV1Schema: false)
24 | {
25 | }
26 |
27 | public static ApplicationDbContext Create()
28 | {
29 | return new ApplicationDbContext();
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Models/Review.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class Review
10 | {
11 | public int ReviewID { get; set; }
12 |
13 | public int AlbumID { get; set; }
14 | public virtual Album Album { get; set; }
15 |
16 | public string Contents { get; set; }
17 |
18 | [Required()]
19 | [Display(Name="Email Address")]
20 | [DataType(DataType.EmailAddress)]
21 | public string ReviewerEmail { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Models/StoreContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.Entity;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class StoreContext : DbContext
10 | {
11 | public DbSet Reviews { get; set; }
12 | public DbSet Albums { get; set; }
13 | public DbSet Artists { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 2 - Models in MVC/MVCMusicStore/Scripts/_references.js
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Startup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Owin;
2 | using Owin;
3 |
4 | [assembly: OwinStartupAttribute(typeof(MVCMusicStore.Startup))]
5 | namespace MVCMusicStore
6 | {
7 | public partial class Startup
8 | {
9 | public void Configuration(IAppBuilder app)
10 | {
11 | ConfigureAuth(app);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/StoreDiagram.cd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | AAAAAAAAAAAAAEAAAACAAAAAAIAAAAAAAACAAAAAAAA=
7 | Models\Album.cs
8 |
9 |
10 |
11 |
12 |
13 | AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAACBAAAAA=
14 | Models\Artist.cs
15 |
16 |
17 |
18 |
19 |
20 | AAAAAAAAAAAAAAAAAACAAAAAABAAAAABAAAACABAAAA=
21 | Models\Review.cs
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "ConfirmAccount";
3 | }
4 |
5 |
@ViewBag.Title.
6 |
7 |
8 | Thank you for confirming your account. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
9 |
10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
11 |
@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })
20 |
@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
4 |
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 2 - Models in MVC/MVCMusicStore/favicon.ico
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 2 - Models in MVC/MVCMusicStore/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 2 - Models in MVC/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/MVCMusicStore/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 2 - Models in MVC/MVCMusicStore/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Module 2 - Models in MVC/readme.txt:
--------------------------------------------------------------------------------
1 | Source code for the Introduction to ASP.NET MVC free training course on June 23, 2014 (http://www.microsoftvirtualacademy.com/liveevents/introduction-to-asp-net-mvc)
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore.Tests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore.Tests/Controllers/HomeControllerTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Web.Mvc;
6 | using Microsoft.VisualStudio.TestTools.UnitTesting;
7 | using MVCMusicStore;
8 | using MVCMusicStore.Controllers;
9 |
10 | namespace MVCMusicStore.Tests.Controllers
11 | {
12 | [TestClass]
13 | public class HomeControllerTest
14 | {
15 | [TestMethod]
16 | public void Index()
17 | {
18 | // Arrange
19 | HomeController controller = new HomeController();
20 |
21 | // Act
22 | ViewResult result = controller.Index() as ViewResult;
23 |
24 | // Assert
25 | Assert.IsNotNull(result);
26 | }
27 |
28 | [TestMethod]
29 | public void About()
30 | {
31 | // Arrange
32 | HomeController controller = new HomeController();
33 |
34 | // Act
35 | ViewResult result = controller.About() as ViewResult;
36 |
37 | // Assert
38 | Assert.AreEqual("Your application description page.", result.ViewBag.Message);
39 | }
40 |
41 | [TestMethod]
42 | public void Contact()
43 | {
44 | // Arrange
45 | HomeController controller = new HomeController();
46 |
47 | // Act
48 | ViewResult result = controller.Contact() as ViewResult;
49 |
50 | // Assert
51 | Assert.IsNotNull(result);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext.mdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 3 - Visual Studio tools/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext.mdf
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext_log.ldf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 3 - Visual Studio tools/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext_log.ldf
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/App_Start/FilterConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web;
2 | using System.Web.Mvc;
3 |
4 | namespace MVCMusicStore
5 | {
6 | public class FilterConfig
7 | {
8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9 | {
10 | filters.Add(new HandleErrorAttribute());
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/App_Start/RouteConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Routing;
7 |
8 | namespace MVCMusicStore
9 | {
10 | public class RouteConfig
11 | {
12 | public static void RegisterRoutes(RouteCollection routes)
13 | {
14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15 |
16 | routes.MapRoute(
17 | name: "Default",
18 | url: "{controller}/{action}/{id}",
19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
20 | );
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Content/Site.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 50px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | /* Set padding to keep content from hitting the edges */
7 | .body-content {
8 | padding-left: 15px;
9 | padding-right: 15px;
10 | }
11 |
12 | /* Set width on the form input elements since they're 100% wide by default */
13 | input,
14 | select,
15 | textarea {
16 | max-width: 280px;
17 | }
18 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 |
7 | namespace MVCMusicStore.Controllers
8 | {
9 | public class HomeController : Controller
10 | {
11 | public ActionResult Index()
12 | {
13 | return View();
14 | }
15 |
16 | public ActionResult About()
17 | {
18 | ViewBag.Message = "Your application description page.";
19 |
20 | return View();
21 | }
22 |
23 | public ActionResult Contact()
24 | {
25 | ViewBag.Message = "Your contact page.";
26 |
27 | return View();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MVCMusicStore.MvcApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Optimization;
7 | using System.Web.Routing;
8 |
9 | namespace MVCMusicStore
10 | {
11 | public class MvcApplication : System.Web.HttpApplication
12 | {
13 | protected void Application_Start()
14 | {
15 | AreaRegistration.RegisterAllAreas();
16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
17 | RouteConfig.RegisterRoutes(RouteTable.Routes);
18 | BundleConfig.RegisterBundles(BundleTable.Bundles);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Models/Album.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Album
9 | {
10 | public int AlbumID { get; set; }
11 |
12 | public string Title { get; set; }
13 |
14 | public Artist Artist { get; set; }
15 |
16 | public virtual List Review { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Models/Artist.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Artist
9 | {
10 | public int ArtistID { get; set; }
11 |
12 | public string Name { get; set; }
13 |
14 | public virtual List Albums { get; set; }
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Models/IdentityModels.cs:
--------------------------------------------------------------------------------
1 | using System.Security.Claims;
2 | using System.Threading.Tasks;
3 | using Microsoft.AspNet.Identity;
4 | using Microsoft.AspNet.Identity.EntityFramework;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
9 | public class ApplicationUser : IdentityUser
10 | {
11 | public async Task GenerateUserIdentityAsync(UserManager manager)
12 | {
13 | // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
14 | var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
15 | // Add custom user claims here
16 | return userIdentity;
17 | }
18 | }
19 |
20 | public class ApplicationDbContext : IdentityDbContext
21 | {
22 | public ApplicationDbContext()
23 | : base("DefaultConnection", throwIfV1Schema: false)
24 | {
25 | }
26 |
27 | public static ApplicationDbContext Create()
28 | {
29 | return new ApplicationDbContext();
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Models/Review.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class Review
10 | {
11 | public int ReviewID { get; set; }
12 |
13 | public int AlbumID { get; set; }
14 | public virtual Album Album { get; set; }
15 |
16 | public string Contents { get; set; }
17 |
18 | [Required()]
19 | [Display(Name="Email Address")]
20 | [DataType(DataType.EmailAddress)]
21 | public string ReviewerEmail { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Models/StoreContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.Entity;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class StoreContext : DbContext
10 | {
11 | public DbSet Reviews { get; set; }
12 | public DbSet Albums { get; set; }
13 | public DbSet Artists { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 3 - Visual Studio tools/MVCMusicStore/Scripts/_references.js
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Startup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Owin;
2 | using Owin;
3 |
4 | [assembly: OwinStartupAttribute(typeof(MVCMusicStore.Startup))]
5 | namespace MVCMusicStore
6 | {
7 | public partial class Startup
8 | {
9 | public void Configuration(IAppBuilder app)
10 | {
11 | ConfigureAuth(app);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/StoreDiagram.cd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | AAAAAAAAAAAAAEAAAACAAAAAAIAAAAAAAACAAAAAAAA=
7 | Models\Album.cs
8 |
9 |
10 |
11 |
12 |
13 | AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAACBAAAAA=
14 | Models\Artist.cs
15 |
16 |
17 |
18 |
19 |
20 | AAAAAAAAAAAAAAAAAACAAAAAABAAAAABAAAACABAAAA=
21 | Models\Review.cs
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "ConfirmAccount";
3 | }
4 |
5 |
@ViewBag.Title.
6 |
7 |
8 | Thank you for confirming your account. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
9 |
10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
11 |
@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })
20 |
@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
4 |
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 3 - Visual Studio tools/MVCMusicStore/favicon.ico
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 3 - Visual Studio tools/MVCMusicStore/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 3 - Visual Studio tools/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/MVCMusicStore/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 3 - Visual Studio tools/MVCMusicStore/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Module 3 - Visual Studio tools/readme.txt:
--------------------------------------------------------------------------------
1 | Source code for the Introduction to ASP.NET MVC free training course on June 23, 2014 (http://www.microsoftvirtualacademy.com/liveevents/introduction-to-asp-net-mvc)
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore.Tests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore.Tests/Controllers/HomeControllerTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Web.Mvc;
6 | using Microsoft.VisualStudio.TestTools.UnitTesting;
7 | using MVCMusicStore;
8 | using MVCMusicStore.Controllers;
9 |
10 | namespace MVCMusicStore.Tests.Controllers
11 | {
12 | [TestClass]
13 | public class HomeControllerTest
14 | {
15 | [TestMethod]
16 | public void Index()
17 | {
18 | // Arrange
19 | HomeController controller = new HomeController();
20 |
21 | // Act
22 | ViewResult result = controller.Index() as ViewResult;
23 |
24 | // Assert
25 | Assert.IsNotNull(result);
26 | }
27 |
28 | [TestMethod]
29 | public void About()
30 | {
31 | // Arrange
32 | HomeController controller = new HomeController();
33 |
34 | // Act
35 | ViewResult result = controller.About() as ViewResult;
36 |
37 | // Assert
38 | Assert.AreEqual("Your application description page.", result.ViewBag.Message);
39 | }
40 |
41 | [TestMethod]
42 | public void Contact()
43 | {
44 | // Arrange
45 | HomeController controller = new HomeController();
46 |
47 | // Act
48 | ViewResult result = controller.Contact() as ViewResult;
49 |
50 | // Assert
51 | Assert.IsNotNull(result);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext.mdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 4 - Customizing Controllers/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext.mdf
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext_log.ldf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 4 - Customizing Controllers/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext_log.ldf
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/App_Start/FilterConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web;
2 | using System.Web.Mvc;
3 |
4 | namespace MVCMusicStore
5 | {
6 | public class FilterConfig
7 | {
8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9 | {
10 | filters.Add(new HandleErrorAttribute());
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/App_Start/RouteConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Routing;
7 |
8 | namespace MVCMusicStore
9 | {
10 | public class RouteConfig
11 | {
12 | public static void RegisterRoutes(RouteCollection routes)
13 | {
14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15 |
16 | routes.MapMvcAttributeRoutes();//Attribute Routing
17 |
18 | routes.MapRoute(
19 | name: "Default",
20 | url: "{controller}/{action}/{id}",
21 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
22 | );
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Content/Site.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 50px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | /* Set padding to keep content from hitting the edges */
7 | .body-content {
8 | padding-left: 15px;
9 | padding-right: 15px;
10 | }
11 |
12 | /* Set width on the form input elements since they're 100% wide by default */
13 | input,
14 | select,
15 | textarea {
16 | max-width: 280px;
17 | }
18 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 |
7 | namespace MVCMusicStore.Controllers
8 | {
9 | public class HomeController : Controller
10 | {
11 | public ActionResult Index()
12 | {
13 | return View();
14 | }
15 |
16 | public ActionResult About()
17 | {
18 | ViewBag.Message = "Your application description page.";
19 |
20 | return View();
21 | }
22 |
23 | public ActionResult Contact()
24 | {
25 | ViewBag.Message = "Your contact page.";
26 |
27 | return View();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MVCMusicStore.MvcApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Optimization;
7 | using System.Web.Routing;
8 |
9 | namespace MVCMusicStore
10 | {
11 | public class MvcApplication : System.Web.HttpApplication
12 | {
13 | protected void Application_Start()
14 | {
15 | AreaRegistration.RegisterAllAreas();
16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
17 | RouteConfig.RegisterRoutes(RouteTable.Routes);
18 | BundleConfig.RegisterBundles(BundleTable.Bundles);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Models/Album.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Album
9 | {
10 | public int AlbumID { get; set; }
11 |
12 | public string Title { get; set; }
13 |
14 | public Artist Artist { get; set; }
15 |
16 | public virtual List Review { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Models/AlbumWithReviewsVM.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class AlbumWithReviewsVM
9 | {
10 | public string AlbumTitle {get; set; }
11 | public List ReviewContent { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Models/Artist.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Artist
9 | {
10 | public int ArtistID { get; set; }
11 |
12 | public string Name { get; set; }
13 |
14 | public virtual List Albums { get; set; }
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Models/IdentityModels.cs:
--------------------------------------------------------------------------------
1 | using System.Security.Claims;
2 | using System.Threading.Tasks;
3 | using Microsoft.AspNet.Identity;
4 | using Microsoft.AspNet.Identity.EntityFramework;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
9 | public class ApplicationUser : IdentityUser
10 | {
11 | public async Task GenerateUserIdentityAsync(UserManager manager)
12 | {
13 | // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
14 | var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
15 | // Add custom user claims here
16 | return userIdentity;
17 | }
18 | }
19 |
20 | public class ApplicationDbContext : IdentityDbContext
21 | {
22 | public ApplicationDbContext()
23 | : base("DefaultConnection", throwIfV1Schema: false)
24 | {
25 | }
26 |
27 | public static ApplicationDbContext Create()
28 | {
29 | return new ApplicationDbContext();
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Models/Review.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class Review
10 | {
11 | public int ReviewID { get; set; }
12 |
13 | public int AlbumID { get; set; }
14 | public virtual Album Album { get; set; }
15 |
16 | public string Contents { get; set; }
17 |
18 | [Required()]
19 | [Display(Name="Email Address")]
20 | [DataType(DataType.EmailAddress)]
21 | public string ReviewerEmail { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Models/StoreContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.Entity;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class StoreContext : DbContext
10 | {
11 | public DbSet Reviews { get; set; }
12 | public DbSet Albums { get; set; }
13 | public DbSet Artists { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 4 - Customizing Controllers/MVCMusicStore/Scripts/_references.js
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Startup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Owin;
2 | using Owin;
3 |
4 | [assembly: OwinStartupAttribute(typeof(MVCMusicStore.Startup))]
5 | namespace MVCMusicStore
6 | {
7 | public partial class Startup
8 | {
9 | public void Configuration(IAppBuilder app)
10 | {
11 | ConfigureAuth(app);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/StoreDiagram.cd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | AAAAAAAAAAAAAEAAAACAAAAAAIAAAAAAAACAAAAAAAA=
7 | Models\Album.cs
8 |
9 |
10 |
11 |
12 |
13 | AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAACBAAAAA=
14 | Models\Artist.cs
15 |
16 |
17 |
18 |
19 |
20 | AAAAAAAAAAAAAAAAAACAAAAAABAAAAABAAAACABAAAA=
21 | Models\Review.cs
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Module 4 - Customizing Controllers/MVCMusicStore/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "ConfirmAccount";
3 | }
4 |
5 |
@ViewBag.Title.
6 |
7 |
8 | Thank you for confirming your account. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
9 |
10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
11 |
8 | Thank you for confirming your account. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
9 |
10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
11 |
@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })
20 |
@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/Module 5 - Customizing Views/MVCMusicStore/MVCMusicStore/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
4 |
--------------------------------------------------------------------------------
/Module 5 - Customizing Views/MVCMusicStore/MVCMusicStore/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 5 - Customizing Views/MVCMusicStore/MVCMusicStore/favicon.ico
--------------------------------------------------------------------------------
/Module 5 - Customizing Views/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 5 - Customizing Views/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Module 5 - Customizing Views/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 5 - Customizing Views/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Module 5 - Customizing Views/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 5 - Customizing Views/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Module 5 - Customizing Views/readme.txt:
--------------------------------------------------------------------------------
1 | Source code for the Introduction to ASP.NET MVC free training course on June 23, 2014 (http://www.microsoftvirtualacademy.com/liveevents/introduction-to-asp-net-mvc)
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore.Tests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore.Tests/Controllers/HomeControllerTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Web.Mvc;
6 | using Microsoft.VisualStudio.TestTools.UnitTesting;
7 | using MVCMusicStore;
8 | using MVCMusicStore.Controllers;
9 |
10 | namespace MVCMusicStore.Tests.Controllers
11 | {
12 | [TestClass]
13 | public class HomeControllerTest
14 | {
15 | [TestMethod]
16 | public void Index()
17 | {
18 | // Arrange
19 | HomeController controller = new HomeController();
20 |
21 | // Act
22 | ViewResult result = controller.Index() as ViewResult;
23 |
24 | // Assert
25 | Assert.IsNotNull(result);
26 | }
27 |
28 | [TestMethod]
29 | public void About()
30 | {
31 | // Arrange
32 | HomeController controller = new HomeController();
33 |
34 | // Act
35 | ViewResult result = controller.About() as ViewResult;
36 |
37 | // Assert
38 | Assert.AreEqual("Your application description page.", result.ViewBag.Message);
39 | }
40 |
41 | [TestMethod]
42 | public void Contact()
43 | {
44 | // Arrange
45 | HomeController controller = new HomeController();
46 |
47 | // Act
48 | ViewResult result = controller.Contact() as ViewResult;
49 |
50 | // Assert
51 | Assert.IsNotNull(result);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext.mdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext.mdf
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext_log.ldf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext_log.ldf
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/App_Start/FilterConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web;
2 | using System.Web.Mvc;
3 |
4 | namespace MVCMusicStore
5 | {
6 | public class FilterConfig
7 | {
8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9 | {
10 | filters.Add(new HandleErrorAttribute());
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/App_Start/RouteConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Routing;
7 |
8 | namespace MVCMusicStore
9 | {
10 | public class RouteConfig
11 | {
12 | public static void RegisterRoutes(RouteCollection routes)
13 | {
14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15 |
16 | routes.MapMvcAttributeRoutes();//Attribute Routing
17 |
18 | routes.MapRoute(
19 | name: "Default",
20 | url: "{controller}/{action}/{id}",
21 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
22 | );
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Content/Site.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 50px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | /* Set padding to keep content from hitting the edges */
7 | .body-content {
8 | padding-left: 15px;
9 | padding-right: 15px;
10 | }
11 |
12 | /* Set width on the form input elements since they're 100% wide by default */
13 | input,
14 | select,
15 | textarea {
16 | max-width: 280px;
17 | }
18 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 |
7 | namespace MVCMusicStore.Controllers
8 | {
9 | public class HomeController : Controller
10 | {
11 | public ActionResult Index()
12 | {
13 | return View();
14 | }
15 |
16 | public ActionResult About()
17 | {
18 | ViewBag.Message = "Your application description page.";
19 |
20 | return View();
21 | }
22 |
23 | public ActionResult Contact()
24 | {
25 | ViewBag.Message = "Your contact page.";
26 |
27 | return View();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MVCMusicStore.MvcApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Optimization;
7 | using System.Web.Routing;
8 |
9 | namespace MVCMusicStore
10 | {
11 | public class MvcApplication : System.Web.HttpApplication
12 | {
13 | protected void Application_Start()
14 | {
15 | AreaRegistration.RegisterAllAreas();
16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
17 | RouteConfig.RegisterRoutes(RouteTable.Routes);
18 | BundleConfig.RegisterBundles(BundleTable.Bundles);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Models/Album.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Album
9 | {
10 | public int AlbumID { get; set; }
11 |
12 | public string Title { get; set; }
13 |
14 | public Artist Artist { get; set; }
15 |
16 | public virtual List Review { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Models/Artist.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Artist
9 | {
10 | public int ArtistID { get; set; }
11 |
12 | public string Name { get; set; }
13 |
14 | public virtual List Albums { get; set; }
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Models/Review.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class Review
10 | {
11 | public int ReviewID { get; set; }
12 |
13 | [Display(Name="Album")]
14 | public int AlbumID { get; set; }
15 | public virtual Album Album { get; set; }
16 |
17 | public string Contents { get; set; }
18 |
19 | [Required()]
20 | [Display(Name="Email Address")]
21 | [DataType(DataType.EmailAddress)]
22 | public string ReviewerEmail { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Models/StoreContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.Entity;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class StoreContext : DbContext
10 | {
11 | public DbSet Reviews { get; set; }
12 | public DbSet Albums { get; set; }
13 | public DbSet Artists { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Scripts/_references.js
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Startup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Owin;
2 | using Owin;
3 |
4 | [assembly: OwinStartupAttribute(typeof(MVCMusicStore.Startup))]
5 | namespace MVCMusicStore
6 | {
7 | public partial class Startup
8 | {
9 | public void Configuration(IAppBuilder app)
10 | {
11 | ConfigureAuth(app);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/StoreDiagram.cd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | AAAAAAAAAAAAAEAAAACAAAAAAIAAAAAAAACAAAAAAAA=
7 | Models\Album.cs
8 |
9 |
10 |
11 |
12 |
13 | AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAACBAAAAA=
14 | Models\Artist.cs
15 |
16 |
17 |
18 |
19 |
20 | AAAAAAAAAAAAAAAAAACAAAAAABAAAAABAAAACABAAAA=
21 | Models\Review.cs
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "ConfirmAccount";
3 | }
4 |
5 |
@ViewBag.Title.
6 |
7 |
8 | Thank you for confirming your account. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
9 |
10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
11 |
@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })
20 |
@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
4 |
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/favicon.ico
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 6 - Introduction to Bootstrap/MVCMusicStore/MVCMusicStore/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/Module 6 - Introduction to Bootstrap/readme.txt:
--------------------------------------------------------------------------------
1 | Source code for the Introduction to ASP.NET MVC free training course on June 23, 2014 (http://www.microsoftvirtualacademy.com/liveevents/introduction-to-asp-net-mvc)
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore.Tests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext.mdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext.mdf
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext_log.ldf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Data/MVCMusicStore.Models.StoreContext_log.ldf
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Data/aspnet-MVCMusicStore-20140623095615.mdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Data/aspnet-MVCMusicStore-20140623095615.mdf
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Data/aspnet-MVCMusicStore-20140623095615_log.ldf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Data/aspnet-MVCMusicStore-20140623095615_log.ldf
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Start/FilterConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web;
2 | using System.Web.Mvc;
3 |
4 | namespace MVCMusicStore
5 | {
6 | public class FilterConfig
7 | {
8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9 | {
10 | filters.Add(new HandleErrorAttribute());
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/App_Start/RouteConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Routing;
7 |
8 | namespace MVCMusicStore
9 | {
10 | public class RouteConfig
11 | {
12 | public static void RegisterRoutes(RouteCollection routes)
13 | {
14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15 |
16 | routes.MapMvcAttributeRoutes();//Attribute Routing
17 |
18 | routes.MapRoute(
19 | name: "Default",
20 | url: "{controller}/{action}/{id}",
21 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
22 | );
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Content/Site.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 50px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | /* Set padding to keep content from hitting the edges */
7 | .body-content {
8 | padding-left: 15px;
9 | padding-right: 15px;
10 | }
11 |
12 | /* Set width on the form input elements since they're 100% wide by default */
13 | input,
14 | select,
15 | textarea {
16 | max-width: 280px;
17 | }
18 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 |
7 | namespace MVCMusicStore.Controllers
8 | {
9 | public class HomeController : Controller
10 | {
11 | public ActionResult Index()
12 | {
13 | return View();
14 | }
15 |
16 | public ActionResult About()
17 | {
18 | ViewBag.Message = "Your application description page.";
19 |
20 | return View();
21 | }
22 |
23 | public ActionResult Contact()
24 | {
25 | ViewBag.Message = "Your contact page.";
26 |
27 | return View();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MVCMusicStore.MvcApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Optimization;
7 | using System.Web.Routing;
8 |
9 | namespace MVCMusicStore
10 | {
11 | public class MvcApplication : System.Web.HttpApplication
12 | {
13 | protected void Application_Start()
14 | {
15 | AreaRegistration.RegisterAllAreas();
16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
17 | RouteConfig.RegisterRoutes(RouteTable.Routes);
18 | BundleConfig.RegisterBundles(BundleTable.Bundles);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Models/Album.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Album
9 | {
10 | public int AlbumID { get; set; }
11 |
12 | public string Title { get; set; }
13 |
14 | public Artist Artist { get; set; }
15 |
16 | public virtual List Review { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Models/Artist.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 |
6 | namespace MVCMusicStore.Models
7 | {
8 | public class Artist
9 | {
10 | public int ArtistID { get; set; }
11 |
12 | public string Name { get; set; }
13 |
14 | public virtual List Albums { get; set; }
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Models/Review.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class Review
10 | {
11 | public int ReviewID { get; set; }
12 |
13 | [Display(Name="Album")]
14 | public int AlbumID { get; set; }
15 | public virtual Album Album { get; set; }
16 |
17 | public string Contents { get; set; }
18 |
19 | [Required()]
20 | [Display(Name="Email Address")]
21 | [DataType(DataType.EmailAddress)]
22 | public string ReviewerEmail { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Models/StoreContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.Entity;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace MVCMusicStore.Models
8 | {
9 | public class StoreContext : DbContext
10 | {
11 | public DbSet Reviews { get; set; }
12 | public DbSet Albums { get; set; }
13 | public DbSet Artists { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jongalloway/MVA-Introduction-to-ASPNET-MVC/6c2de43854c7272b2566655cab73d69a23f5312b/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Scripts/_references.js
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Startup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Owin;
2 | using Owin;
3 |
4 | [assembly: OwinStartupAttribute(typeof(MVCMusicStore.Startup))]
5 | namespace MVCMusicStore
6 | {
7 | public partial class Startup
8 | {
9 | public void Configuration(IAppBuilder app)
10 | {
11 | ConfigureAuth(app);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/StoreDiagram.cd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | AAAAAAAAAAAAAEAAAACAAAAAAIAAAAAAAACAAAAAAAA=
7 | Models\Album.cs
8 |
9 |
10 |
11 |
12 |
13 | AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAACBAAAAA=
14 | Models\Artist.cs
15 |
16 |
17 |
18 |
19 |
20 | AAAAAAAAAAAAAAAAAACAAAAAABAAAAABAAAACABAAAA=
21 | Models\Review.cs
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Module 7 - Introduction to Authentication/MVCMusicStore/MVCMusicStore/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "ConfirmAccount";
3 | }
4 |
5 |
@ViewBag.Title.
6 |
7 |
8 | Thank you for confirming your account. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
9 |
10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
11 |
23 | @foreach (AuthenticationDescription p in loginProviders) 24 | { 25 | 26 | } 27 |
28 |