1 00:00:00,260 --> 00:00:01,630 In an earlier course, 2 00:00:01,630 --> 00:00:06,470 we saw how to use EF to update a comic book library manager console application. 3 00:00:06,470 --> 00:00:10,610 So, the users could create, update and delete comic books. 4 00:00:10,610 --> 00:00:13,910 But the application had a number of limitations that made it 5 00:00:13,910 --> 00:00:15,900 a sub optimal solutions. 6 00:00:15,900 --> 00:00:16,530 For one. 7 00:00:16,530 --> 00:00:19,250 It only supported a single concurrent user. 8 00:00:19,250 --> 00:00:24,070 And, because it was a console application, it could only be used from a desktop, or 9 00:00:24,070 --> 00:00:25,320 a laptop computer. 10 00:00:25,320 --> 00:00:28,600 Today's users expect more from their applications. 11 00:00:28,600 --> 00:00:32,220 Welcome to the comic book library manager web app. 12 00:00:32,220 --> 00:00:36,050 While the console application was limited to working with comic books, 13 00:00:36,050 --> 00:00:40,710 the web app allows users to work with comic books, series, and artists. 14 00:00:40,710 --> 00:00:45,758 For each of these main record types, we can view a list of the available records. 15 00:00:45,758 --> 00:00:50,670 View the detail for a single record, update a record, 16 00:00:53,490 --> 00:00:57,850 delete a record, or add a new record. 17 00:01:00,140 --> 00:01:04,260 For comic books it goes even further by allowing users to add, 18 00:01:04,260 --> 00:01:06,920 or remove artists from a comic book. 19 00:01:06,920 --> 00:01:10,550 To do this, you start by viewing the detail for a comic book. 20 00:01:10,550 --> 00:01:13,418 From here you can add an artist to a comic book. 21 00:01:15,370 --> 00:01:17,259 Or delete an artist. 22 00:01:19,279 --> 00:01:21,394 The relationship between comic books and 23 00:01:21,394 --> 00:01:24,410 artist is known as a many to many relationship. 24 00:01:24,410 --> 00:01:27,330 That is, a comic book can be associated with one, or 25 00:01:27,330 --> 00:01:32,110 more artists, and an artist can be associated with one, or more comic books. 26 00:01:32,110 --> 00:01:35,410 This is the first time that we've seen a user interface from managing 27 00:01:35,410 --> 00:01:39,680 a many to many relationship, and probably won't surprise you to hear 28 00:01:39,680 --> 00:01:42,900 that there are a variety of ways to handle this requirement. 29 00:01:42,900 --> 00:01:47,560 See the teacher's notes for information on how JavaScript can be used to create user 30 00:01:47,560 --> 00:01:52,460 friendly UIs for managing one to many, or many to many relationships. 31 00:01:53,620 --> 00:01:54,690 One more thing. 32 00:01:54,690 --> 00:01:59,420 The comic book library manager web app also works great on smart phone devices 33 00:01:59,420 --> 00:02:01,510 by utilizing a responsive design, 34 00:02:01,510 --> 00:02:05,280 the web app is able to automatically adjust to smaller screens. 35 00:02:05,280 --> 00:02:09,482 The top menu is now hidden until we tap this hamburger button. 36 00:02:12,519 --> 00:02:16,200 And the two column form layout adjusts to use a single column. 37 00:02:18,400 --> 00:02:22,140 For more information about how to create layouts using Responsive Design, 38 00:02:22,140 --> 00:02:23,960 see the teacher's notes. 39 00:02:23,960 --> 00:02:27,510 Let's review the steps that we'll take to set up our solution. 40 00:02:27,510 --> 00:02:31,830 The first part of the process is related to setting up the class library project. 41 00:02:31,830 --> 00:02:34,130 We'll start by downloading the project files for 42 00:02:34,130 --> 00:02:36,670 the comic book library manager console app. 43 00:02:36,670 --> 00:02:40,170 Console App project contains classes related to EF 44 00:02:40,170 --> 00:02:42,740 that our web app project will need access to. 45 00:02:42,740 --> 00:02:48,350 Including the Entity, Context, and Database Initializer classes. 46 00:02:48,350 --> 00:02:51,750 In order to share those classes with both the Console App and 47 00:02:51,750 --> 00:02:56,230 Web App projects, we'll add a Class Library project to the solution, and 48 00:02:56,230 --> 00:02:59,950 move those classes from the Console App to the Class Library. 49 00:02:59,950 --> 00:03:02,850 Utilizing a class library is a common approach for 50 00:03:02,850 --> 00:03:05,580 sharing code across two, or more projects. 51 00:03:05,580 --> 00:03:10,060 Then, we'll update the Console App project with the reference to the class library 52 00:03:10,060 --> 00:03:14,400 and tweak some name spaces in order to get the app compiling again. 53 00:03:14,400 --> 00:03:18,320 At this point, the console lab will work as as it did before. 54 00:03:18,320 --> 00:03:23,570 The second part of the process is related to setting up the ASP.NET MVC project. 55 00:03:23,570 --> 00:03:28,690 We'll start by adding an empty ASP.NET MVC web app project to our solution. 56 00:03:28,690 --> 00:03:33,280 Then, in order to give the web app access to the EF related classes in the class 57 00:03:33,280 --> 00:03:37,870 library, we'll update the web app with a reference to the class library project. 58 00:03:37,870 --> 00:03:41,410 To complete the setup process, we'll a set of start up files for 59 00:03:41,410 --> 00:03:44,630 the web app and add them to the MVC project. 60 00:03:44,630 --> 00:03:49,190 Our completed solution will contain three projects, the original console app 61 00:03:49,190 --> 00:03:55,820 project, a new class library project, and a new ASP.NET MVC project. 62 00:03:55,820 --> 00:04:00,220 In the next two videos will download the starter project, move our EF related code 63 00:04:00,220 --> 00:04:05,540 to our class library project, and add an ASP.net MVC project to our solution.