SlideShare uma empresa Scribd logo
1 de 50
Restaurant Delivery
Thiago Silva
Kevin Trinh
This is a hand on
ASP.NET Core MVC application
built with Entity Framework Core
using the database first approach
What are we building ?
1
Create a SQL db
with defined
schema.
Create a ASP.Net
Core app and
scaffold the
models.
Add a bootstrap
cards display on
the home page.
Construct some
crud functionality,
including image
upload
2 3 4
Creating the Db
Open Sql server
management studio
Connect to your local db
Create a new database
1
2
3
4
5
Name your new database,
preferably “RestaurantDelivery”
Once created, right click on it and
select New Query
7
6
Copy the query block /*Creation*/
in the comments into the query
window and run it with “F5”
Next, copy and past the
/*Validation*/ block and check the
tables data. The result should be
close to this example ---->
Resulting database diagram
Starting the App
1
Open visual studio and
select “Create a new
project”
2
Select “ASP.NET Core Web
Application” project type
3
Select “ASP.NET
Core Web
Application” project
type.
Name your project
and select its
location
4 Next, choose “Web
application (Model-
View-Controller)”
option.
*make sure to mark ASP.NET Core 2.1 or
higher
5
Next, right click on the
project and select
“Manage NuGet
Packages”
6
Click on Browse and look
for EnityFrameworkCore.
In the results, select and
install the package
Microsoft.Entity.Framewor
kCore.Tools
*select the highest version lower than 3.0
Scaffolding models
1 Locate the Package
Manager Console on
the bottom of visual
studio window.
2 Paste the scaffolding
command and press
“Enter”
*Attention to the database name and
context name you give.
3 Check if the models
were created
4 Adjust the Context class by removing the
code selected. The connection string will
be passed later.
4
(Optional)Adjust the
navigation properties
names on the Order
class file
5
Add the connection string
entry to your
appsettings.json
5 Right click on the project
and create a new folder.
Name it “Repository”
6 Right click on
the repository
folder and add a
new interface.
Name it
“IRepository”
Code in the
comments.
*Adjust the namespace
accordingly
7 Right click on
the repository
folder and add a
new class.
Name it
“RetaurantRepo
sitory”
Code in the
comments.
*Adjust the namespace
accordingly
8 Go to the
Startup.cs file
and inject the
DbContext and
the new
Repository as
shown.
9 Right click on the Controller folder
and add a new Controller
10 Select the option show
11 Select Restaurant model class and your
context respectively, click Add
13
Go to the
RestaurantsController
class and adjust it to use
the respository we
implemented before
*Code on the comments.
Adjust the namespace
12
Next, there will be a new
controller and some new
files on restaurants folder
13 Add a new
menu item
on the nav
bar on the
_Layout file
14
Change your run
option to use kerstel
(your project name)
Launch it !
Order and MenuItem
1
Right click on
Respository folder and
add new class.
Name it
MenuItemRespository
*Code in the comments
2
Do it again but this
time name the new
file as
OrderRespository
*Code also in the
comments
3
Repository folder
should look like this:
4 Right click on the Controller folder
and add a new Controller
5 Select Order model and your context
respectively, than adjust the
controller code with the one in the
comments to make it use the
respective repository
6 Again, right click on the Controller
folder and add a new Controller
7 Select MenuItem model and your
context respectively, than adjust it
using the comments
8 Check out your Controllers and
View folders, they should look like
this
9 Open the Index file
on Orders folder
and fix navigation
properties
10 On the _Layout file add
two more items on the nav
bar
11 Finally, adjust your
startup.cs to inject the new
repositories
Launch it !
Adding image upload
1
To add an image to the top left side of
on the nav bar, download some image
you like and add the snippet as shown
on the _Layout file
2 Something is missing !
Move on and open the
Index file on the
Restaurants view folder
3
Add the snippet
as shown
3 Change the
restaurant view
Edit to have a
new input and a
different value
for the enctype
property
4 The Index view should
be adjusted to show
the image
5 Now, go to the
RestaurantsController, and observe
edit method that handle the image
input
Launch it !
Better home page
1 Open the
HomeControlle
r
and change it
to receive the
restaurant
repository
2 Change the
Index Home
view to show
one card for
each restaurant
received
Launch it !
Thank you

Mais conteúdo relacionado

Semelhante a IEEE Toronto Centennial Workshop: Building An ASP.NET Core Application

SharePoint Project Phase 3 to 4
SharePoint Project Phase 3 to 4SharePoint Project Phase 3 to 4
SharePoint Project Phase 3 to 4msolangon
 
Adapters db-104-informixstoredprocedure
Adapters db-104-informixstoredprocedureAdapters db-104-informixstoredprocedure
Adapters db-104-informixstoredprocedureprathap kumar
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web MahmoudOHassouna
 
Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7helpido9
 
Django: Advanced Models
Django: Advanced ModelsDjango: Advanced Models
Django: Advanced ModelsYing-An Lai
 
Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Mohamed Saleh
 
How to broadcast a b ex report through e
How to broadcast a b ex report through eHow to broadcast a b ex report through e
How to broadcast a b ex report through eZaynab Fadlallah
 
( 4 ) Office 2007 Configure The Official Records Site
( 4 ) Office 2007   Configure The Official Records Site( 4 ) Office 2007   Configure The Official Records Site
( 4 ) Office 2007 Configure The Official Records SiteLiquidHub
 
SYSTEMS DESIGN / CAPSTONE PROJECT
SYSTEMS DESIGN / CAPSTONE PROJECTSYSTEMS DESIGN / CAPSTONE PROJECT
SYSTEMS DESIGN / CAPSTONE PROJECTSanjay Saluth
 
( 5 ) Office 2007 Create A Business Data Catolog
( 5 ) Office 2007   Create A Business Data Catolog( 5 ) Office 2007   Create A Business Data Catolog
( 5 ) Office 2007 Create A Business Data CatologLiquidHub
 
OBIEE: How to change dashboard background color or add background image
OBIEE: How to change dashboard background color or add background imageOBIEE: How to change dashboard background color or add background image
OBIEE: How to change dashboard background color or add background imageMohamed Attia
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseindiappsdevelopment
 
( 6 ) Office 2007 Accessing A Business Data Catolog
( 6 ) Office 2007   Accessing A Business Data Catolog( 6 ) Office 2007   Accessing A Business Data Catolog
( 6 ) Office 2007 Accessing A Business Data CatologLiquidHub
 
SharePoint Project Phase 1 And 2
SharePoint Project Phase 1 And 2SharePoint Project Phase 1 And 2
SharePoint Project Phase 1 And 2msolangon
 
How to Install Node.js on cPanel.pdf
How to Install Node.js on cPanel.pdfHow to Install Node.js on cPanel.pdf
How to Install Node.js on cPanel.pdfHost It Smart
 
( 6 ) Office 2007 Accessing A Business Data Catolog
( 6 ) Office 2007   Accessing A Business Data Catolog( 6 ) Office 2007   Accessing A Business Data Catolog
( 6 ) Office 2007 Accessing A Business Data CatologLiquidHub
 
Adding a view
Adding a viewAdding a view
Adding a viewNhan Do
 
How to develop a gateway service using code based implementation
How to develop a gateway service using code based implementationHow to develop a gateway service using code based implementation
How to develop a gateway service using code based implementationnitin2517
 

Semelhante a IEEE Toronto Centennial Workshop: Building An ASP.NET Core Application (20)

SharePoint Project Phase 3 to 4
SharePoint Project Phase 3 to 4SharePoint Project Phase 3 to 4
SharePoint Project Phase 3 to 4
 
Mvc summary
Mvc summaryMvc summary
Mvc summary
 
Adapters db-104-informixstoredprocedure
Adapters db-104-informixstoredprocedureAdapters db-104-informixstoredprocedure
Adapters db-104-informixstoredprocedure
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web
 
Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7
 
Django: Advanced Models
Django: Advanced ModelsDjango: Advanced Models
Django: Advanced Models
 
Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
How to broadcast a b ex report through e
How to broadcast a b ex report through eHow to broadcast a b ex report through e
How to broadcast a b ex report through e
 
( 4 ) Office 2007 Configure The Official Records Site
( 4 ) Office 2007   Configure The Official Records Site( 4 ) Office 2007   Configure The Official Records Site
( 4 ) Office 2007 Configure The Official Records Site
 
SYSTEMS DESIGN / CAPSTONE PROJECT
SYSTEMS DESIGN / CAPSTONE PROJECTSYSTEMS DESIGN / CAPSTONE PROJECT
SYSTEMS DESIGN / CAPSTONE PROJECT
 
( 5 ) Office 2007 Create A Business Data Catolog
( 5 ) Office 2007   Create A Business Data Catolog( 5 ) Office 2007   Create A Business Data Catolog
( 5 ) Office 2007 Create A Business Data Catolog
 
OBIEE: How to change dashboard background color or add background image
OBIEE: How to change dashboard background color or add background imageOBIEE: How to change dashboard background color or add background image
OBIEE: How to change dashboard background color or add background image
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically development
 
( 6 ) Office 2007 Accessing A Business Data Catolog
( 6 ) Office 2007   Accessing A Business Data Catolog( 6 ) Office 2007   Accessing A Business Data Catolog
( 6 ) Office 2007 Accessing A Business Data Catolog
 
SharePoint Project Phase 1 And 2
SharePoint Project Phase 1 And 2SharePoint Project Phase 1 And 2
SharePoint Project Phase 1 And 2
 
How to Install Node.js on cPanel.pdf
How to Install Node.js on cPanel.pdfHow to Install Node.js on cPanel.pdf
How to Install Node.js on cPanel.pdf
 
( 6 ) Office 2007 Accessing A Business Data Catolog
( 6 ) Office 2007   Accessing A Business Data Catolog( 6 ) Office 2007   Accessing A Business Data Catolog
( 6 ) Office 2007 Accessing A Business Data Catolog
 
Adding a view
Adding a viewAdding a view
Adding a view
 
How to develop a gateway service using code based implementation
How to develop a gateway service using code based implementationHow to develop a gateway service using code based implementation
How to develop a gateway service using code based implementation
 

Último

State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 

Último (20)

State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 

IEEE Toronto Centennial Workshop: Building An ASP.NET Core Application

  • 2. This is a hand on ASP.NET Core MVC application built with Entity Framework Core using the database first approach
  • 3. What are we building ? 1 Create a SQL db with defined schema. Create a ASP.Net Core app and scaffold the models. Add a bootstrap cards display on the home page. Construct some crud functionality, including image upload 2 3 4
  • 5. Open Sql server management studio Connect to your local db Create a new database 1 2 3
  • 6. 4 5 Name your new database, preferably “RestaurantDelivery” Once created, right click on it and select New Query
  • 7. 7 6 Copy the query block /*Creation*/ in the comments into the query window and run it with “F5” Next, copy and past the /*Validation*/ block and check the tables data. The result should be close to this example ---->
  • 10. 1 Open visual studio and select “Create a new project”
  • 11. 2 Select “ASP.NET Core Web Application” project type
  • 12. 3 Select “ASP.NET Core Web Application” project type. Name your project and select its location
  • 13. 4 Next, choose “Web application (Model- View-Controller)” option. *make sure to mark ASP.NET Core 2.1 or higher
  • 14. 5 Next, right click on the project and select “Manage NuGet Packages” 6 Click on Browse and look for EnityFrameworkCore. In the results, select and install the package Microsoft.Entity.Framewor kCore.Tools *select the highest version lower than 3.0
  • 16. 1 Locate the Package Manager Console on the bottom of visual studio window. 2 Paste the scaffolding command and press “Enter” *Attention to the database name and context name you give. 3 Check if the models were created
  • 17. 4 Adjust the Context class by removing the code selected. The connection string will be passed later.
  • 18. 4 (Optional)Adjust the navigation properties names on the Order class file 5 Add the connection string entry to your appsettings.json
  • 19. 5 Right click on the project and create a new folder. Name it “Repository”
  • 20. 6 Right click on the repository folder and add a new interface. Name it “IRepository” Code in the comments. *Adjust the namespace accordingly
  • 21. 7 Right click on the repository folder and add a new class. Name it “RetaurantRepo sitory” Code in the comments. *Adjust the namespace accordingly
  • 22. 8 Go to the Startup.cs file and inject the DbContext and the new Repository as shown.
  • 23. 9 Right click on the Controller folder and add a new Controller
  • 24. 10 Select the option show 11 Select Restaurant model class and your context respectively, click Add
  • 25. 13 Go to the RestaurantsController class and adjust it to use the respository we implemented before *Code on the comments. Adjust the namespace 12 Next, there will be a new controller and some new files on restaurants folder
  • 26. 13 Add a new menu item on the nav bar on the _Layout file 14 Change your run option to use kerstel (your project name)
  • 29. 1 Right click on Respository folder and add new class. Name it MenuItemRespository *Code in the comments
  • 30. 2 Do it again but this time name the new file as OrderRespository *Code also in the comments 3 Repository folder should look like this:
  • 31. 4 Right click on the Controller folder and add a new Controller 5 Select Order model and your context respectively, than adjust the controller code with the one in the comments to make it use the respective repository
  • 32. 6 Again, right click on the Controller folder and add a new Controller 7 Select MenuItem model and your context respectively, than adjust it using the comments
  • 33. 8 Check out your Controllers and View folders, they should look like this
  • 34. 9 Open the Index file on Orders folder and fix navigation properties
  • 35. 10 On the _Layout file add two more items on the nav bar
  • 36. 11 Finally, adjust your startup.cs to inject the new repositories
  • 39.
  • 40. 1 To add an image to the top left side of on the nav bar, download some image you like and add the snippet as shown on the _Layout file
  • 41. 2 Something is missing ! Move on and open the Index file on the Restaurants view folder 3 Add the snippet as shown
  • 42. 3 Change the restaurant view Edit to have a new input and a different value for the enctype property
  • 43. 4 The Index view should be adjusted to show the image
  • 44. 5 Now, go to the RestaurantsController, and observe edit method that handle the image input
  • 47. 1 Open the HomeControlle r and change it to receive the restaurant repository
  • 48. 2 Change the Index Home view to show one card for each restaurant received