SlideShare a Scribd company logo
1 of 31
ASP.NET MVC
@{ Introduction & Guidelines }
Speaker Introduction
Dev Raj Gautam
Application & Database Specialist
Nutrition Innovation Lab: Nepal
Active Contributor @ASP.NET Community
http://blogs.devgautam.com.np/
Have been in industry since 2009. Worked with government, local
companies, outsourcing companies and Ingo's .
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Agenda
• Introduction to MVC
• What Does MVC Offer?
• Demo
• Routing & Web API.
• Web Forms Or MVC?
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Introduction
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Asp.Net MVC1
Released on Mar 13, 2009
ASP.NET Web Forms is not part of ASP.NET 5
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
I was already there from
70’s
MVC
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
MVC
• Stands for Model View Controller. Common design pattern for
• MVC is a software architectural pattern that follows the 'Separation of
Concerns' principle. This principle divides an application into three
interconnected parts as Model, View and Controller each with very
specific set of responsibilities. The goal of this pattern is that each of
these parts can be developed and tested in relative isolation and then
combine together to create a very robust application.
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Model-View-Controller
• Model: These are the classes that contain data. They can practically
be any class that can be instantiated and can provide some data.
These can be entity framework generated entities, collection, generics
or even generic collections too.
• Controllers: These are the classes that will be invoked on user
requests. The main tasks of these are to generate the model class
object, pass them to some view and tell the view to generate markup
and render it on user browser.
• Views: The part of the application that handles user interaction.
Typically controllers read data from a view, control user input, and
send input data to the model.
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
How MVC Works?
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
What does MVC Offer?
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Performance
• ASP.NET MVC don’t have support for view state, so there will not be
any automatic state management which reduces the page size and so
gain the performance.
ViewState
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Separation Of Concern
• When we talk about Views and Controllers, their ownership itself
explains separation.The Views are just the presentation form of an
application, it does not need to know specifically about the requests
coming from the Controller. The Model is independent of Views and
Controllers, it only holds business entities that can be ed to any View
by the Controller as per the needs for exposing them to the end user.
The Controller is independent of Views and Models, its sole purpose
is to handle requests and them on as per the routes defined and as
per the needs of the rendering Views. Thus our business entities
(Model), business logic (Controllers) and presentation logic (Views) lie
in logical/physical layers independent of each other.
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Existing ASP.NET Features
• ASP.NET MVC framework is built on top of matured ASP.NET
framework and thus provides developer to use many good features
such as forms authentication, windows authentication, caching,
session and profile state management etc.
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Parallel Development
• In ASP.NET MVC layers are loosely coupled with each other, so one
developer can work on Controller ,at the same time other on View
and third developer on Model. This is called parallel development.
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Full Control Over <HTML></HTML>
• ASP.NET MVC doesn’t support server controls, only option available is
using html input controls, so we will be sure about final html
rendered at the end. We will also be aware about 'id' of every
element. And so integration of ASP.NET MVC application with third
party JavaScript libraries like jQuery becomes easy.
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Testing
• Asp.Net webforms is dependent on HttpContext.Current, our pages as
part of the HttpApplication executing the request Which makes
• These are all easily mockable!
• HttpContextBase, HttpResponseBase, HttpRequestBase
[TestMethod]
public void ShowPostsDisplayPostView()
{
BlogController controller = new BlogController(…);
var result = controller.ShowPost(2) as ViewResult;
Assert.IsNotNull(result);
Assert.AreEqual(result.ViewData["Message"], "Hello");
}
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Testing
• [TestMethod]
• public void TestInvalidCredentials()
• {
• LoginController controller = new LoginController();
• var mock = new Mock<System.Web.Security.MembershipProvider>();
• mock.Expect(m => m.ValidateUser("", "")).Returns(false);
• controller.MembershipProviderInstance = mock.Object;
• var result = controller.Authenticate("", "") as ViewResult;
• Assert.IsNotNull(result);
• Assert.AreEqual(result.ViewName, "Index");
• Assert.AreEqual(controller.ViewData["ErrorMessage"], "Invalid credentials!
Please verify your username and password.");
• }
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Clean URLS
• ASP.NET MVC is so tightly integrated with the ASP.NET Routing engine,
it is simple to take control over the URLs that your application
exposes.
Would you use:
/Products.aspx?CategoryID={3F2504E0-4F89-11D3-9A0C-0305E82C3301}
Or:
/Products/Books
SEO
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Demo
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
What’s In Demo
• Understanding the MVC Project Structure
• Understanding and Modifying the Layout and Templeates
• CRUD with project template
• CRUD DIY with code
• Basics of Routing
• Basics of Web API
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Routing & Web API
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Routing
• Routing maps request URL to a specific controller action using a
Routing Table
• Routing Engine uses routing rules that are defined in Global.asax file
in order to parse the URL and find out the path of corresponding
controller.
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
WEB API
• Restful framework for Building HTTP Based services
• What is Rest? “Rest is an architectural style that abstracts the
architectural elements within a distributed hypermedia system”
• https://api.twitter.com/1.1/statuses/retweets/2.json
• Web API is not MVC
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
What In the
World Is WCF
Then? HUH!!!!
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Use When?
Web API
• Only working with HTTP
• Want RESTful endpoints
• Don’t need multiple protocols
• Don’t expose SOAP endpoints
• Want Simple Configuration
WCF
• Needs to support multiple
protocols
• Need to expose SOAP endpoints
• Need Complex Configuration
• Need RPC Style Requests
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Web Forms or MVC?
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Web Forms or MVC?
Web Froms
• Winforms-alike event model
• Familiar controls & Rich
• Familiar = rapid application
development
• Functionality per page
• Uses viewstate for state
management
• Less control over rendered HTML
• Event Driven Programming
• Oh wow! I can turn of or control
View State Size.
MVC
• Less complex: separation of
concerns
• Easier parallel development
• TDD support
• No viewstate, …
• Full control over behavior and
HTML
• Extensive Javascript
• Makes you think
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Web Forms or MVC?
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Web Forms or MVC?
• Mixing the Technologies can also do wonders for some solutions
MVC Web Forms
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Verdict?
• Please decide on your own on the basis of previous slides.
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
Thank You
©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/

More Related Content

What's hot (20)

ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
MVC Seminar Presantation
MVC Seminar PresantationMVC Seminar Presantation
MVC Seminar Presantation
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin Sawant
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
ASP.NET MVC for Begineers
ASP.NET MVC for BegineersASP.NET MVC for Begineers
ASP.NET MVC for Begineers
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training session
 
Silver Light By Nyros Developer
Silver Light By Nyros DeveloperSilver Light By Nyros Developer
Silver Light By Nyros Developer
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
MVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,MobileMVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,Mobile
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
Model view controller (mvc)
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)
 
Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fair
 
Mvc fundamental
Mvc fundamentalMvc fundamental
Mvc fundamental
 
What's new in asp.net mvc 4
What's new in asp.net mvc 4What's new in asp.net mvc 4
What's new in asp.net mvc 4
 

Viewers also liked

DotNet programming & Practices
DotNet programming & PracticesDotNet programming & Practices
DotNet programming & PracticesDev Raj Gautam
 
Industrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netIndustrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netPankaj Kushwaha
 
El sectorterciari pvr
El sectorterciari pvrEl sectorterciari pvr
El sectorterciari pvrllulsil23
 
Plant climo office(1) (1)
Plant climo office(1) (1)Plant climo office(1) (1)
Plant climo office(1) (1)llulsil23
 
Aix admin-course-provider-navi-mumbai
Aix admin-course-provider-navi-mumbaiAix admin-course-provider-navi-mumbai
Aix admin-course-provider-navi-mumbaianshkhurana01
 
Ci powerpoint
Ci powerpointCi powerpoint
Ci powerpointtanyacork
 
Cameron Frost - Photography - Mackenzie Claude
Cameron Frost - Photography - Mackenzie ClaudeCameron Frost - Photography - Mackenzie Claude
Cameron Frost - Photography - Mackenzie ClaudeCameron Frost
 
Java j2ee-training-course-navi-mumbai-java-j2ee-course-provider-navi-mumbai
Java j2ee-training-course-navi-mumbai-java-j2ee-course-provider-navi-mumbaiJava j2ee-training-course-navi-mumbai-java-j2ee-course-provider-navi-mumbai
Java j2ee-training-course-navi-mumbai-java-j2ee-course-provider-navi-mumbaianshkhurana01
 
Tibco training-course-navi-mumbai-tibco-course-provider-navi-mumbai
Tibco training-course-navi-mumbai-tibco-course-provider-navi-mumbaiTibco training-course-navi-mumbai-tibco-course-provider-navi-mumbai
Tibco training-course-navi-mumbai-tibco-course-provider-navi-mumbaianshkhurana01
 
E&C Вrodaband 2015 Власть перезагрузка создание коммуникациинной платформы дл...
E&C Вrodaband 2015 Власть перезагрузка создание коммуникациинной платформы дл...E&C Вrodaband 2015 Власть перезагрузка создание коммуникациинной платформы дл...
E&C Вrodaband 2015 Власть перезагрузка создание коммуникациинной платформы дл...Expert and Consulting (EnC)
 
sas-course-provider-navi-mumbai-sas-training-navi-mumbai-sas-classes-navi-mumbai
sas-course-provider-navi-mumbai-sas-training-navi-mumbai-sas-classes-navi-mumbaisas-course-provider-navi-mumbai-sas-training-navi-mumbai-sas-classes-navi-mumbai
sas-course-provider-navi-mumbai-sas-training-navi-mumbai-sas-classes-navi-mumbaianshkhurana01
 
Capital steel buildings business opportunities-uk
Capital steel buildings  business opportunities-ukCapital steel buildings  business opportunities-uk
Capital steel buildings business opportunities-ukRehmat Ullah
 

Viewers also liked (18)

DotNet programming & Practices
DotNet programming & PracticesDotNet programming & Practices
DotNet programming & Practices
 
Why MVC?
Why MVC?Why MVC?
Why MVC?
 
Industrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netIndustrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.net
 
Double cartridge seal
Double cartridge sealDouble cartridge seal
Double cartridge seal
 
El sectorterciari pvr
El sectorterciari pvrEl sectorterciari pvr
El sectorterciari pvr
 
What is Split seals?
What is Split seals?What is Split seals?
What is Split seals?
 
Plant climo office(1) (1)
Plant climo office(1) (1)Plant climo office(1) (1)
Plant climo office(1) (1)
 
Pathos presentation
Pathos presentationPathos presentation
Pathos presentation
 
Aix admin-course-provider-navi-mumbai
Aix admin-course-provider-navi-mumbaiAix admin-course-provider-navi-mumbai
Aix admin-course-provider-navi-mumbai
 
Ci powerpoint
Ci powerpointCi powerpoint
Ci powerpoint
 
What is Spiral Wound Gaskets?
What is Spiral Wound Gaskets?What is Spiral Wound Gaskets?
What is Spiral Wound Gaskets?
 
Cameron Frost - Photography - Mackenzie Claude
Cameron Frost - Photography - Mackenzie ClaudeCameron Frost - Photography - Mackenzie Claude
Cameron Frost - Photography - Mackenzie Claude
 
Java j2ee-training-course-navi-mumbai-java-j2ee-course-provider-navi-mumbai
Java j2ee-training-course-navi-mumbai-java-j2ee-course-provider-navi-mumbaiJava j2ee-training-course-navi-mumbai-java-j2ee-course-provider-navi-mumbai
Java j2ee-training-course-navi-mumbai-java-j2ee-course-provider-navi-mumbai
 
Tibco training-course-navi-mumbai-tibco-course-provider-navi-mumbai
Tibco training-course-navi-mumbai-tibco-course-provider-navi-mumbaiTibco training-course-navi-mumbai-tibco-course-provider-navi-mumbai
Tibco training-course-navi-mumbai-tibco-course-provider-navi-mumbai
 
E&C Вrodaband 2015 Власть перезагрузка создание коммуникациинной платформы дл...
E&C Вrodaband 2015 Власть перезагрузка создание коммуникациинной платформы дл...E&C Вrodaband 2015 Власть перезагрузка создание коммуникациинной платформы дл...
E&C Вrodaband 2015 Власть перезагрузка создание коммуникациинной платформы дл...
 
05php
05php05php
05php
 
sas-course-provider-navi-mumbai-sas-training-navi-mumbai-sas-classes-navi-mumbai
sas-course-provider-navi-mumbai-sas-training-navi-mumbai-sas-classes-navi-mumbaisas-course-provider-navi-mumbai-sas-training-navi-mumbai-sas-classes-navi-mumbai
sas-course-provider-navi-mumbai-sas-training-navi-mumbai-sas-classes-navi-mumbai
 
Capital steel buildings business opportunities-uk
Capital steel buildings  business opportunities-ukCapital steel buildings  business opportunities-uk
Capital steel buildings business opportunities-uk
 

Similar to ASP.NET MVC Introduction & Guidelines

Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework Yakov Fain
 
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.netConcetto Labs
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople
 
Difference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvcDifference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvcUmar Ali
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSShyjal Raazi
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesAaron Jacobson
 
Introduction to SPAs with AngularJS
Introduction to SPAs with AngularJSIntroduction to SPAs with AngularJS
Introduction to SPAs with AngularJSLaurent Duveau
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCAnkit Kashyap
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Naresh Chintalcheru
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetIndiandotnet
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSGil Fink
 
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...ate.douma
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...WebStackAcademy
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentationMaslowB
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationStephen Fuqua
 

Similar to ASP.NET MVC Introduction & Guidelines (20)

Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.net
 
Mvc
MvcMvc
Mvc
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
 
Difference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvcDifference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvc
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Sitecore mvc
Sitecore mvcSitecore mvc
Sitecore mvc
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development services
 
Webinar MVC6
Webinar MVC6Webinar MVC6
Webinar MVC6
 
Introduction to SPAs with AngularJS
Introduction to SPAs with AngularJSIntroduction to SPAs with AngularJS
Introduction to SPAs with AngularJS
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVC
 
Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJS
 
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test Automation
 
Asp.net,mvc
Asp.net,mvcAsp.net,mvc
Asp.net,mvc
 

More from Dev Raj Gautam

RED’S, GREEN’S & BLUE’S OF PROJECT/PRODUCT MANAGEMENT
RED’S, GREEN’S & BLUE’S  OF  PROJECT/PRODUCT MANAGEMENTRED’S, GREEN’S & BLUE’S  OF  PROJECT/PRODUCT MANAGEMENT
RED’S, GREEN’S & BLUE’S OF PROJECT/PRODUCT MANAGEMENTDev Raj Gautam
 
Making machinelearningeasier
Making machinelearningeasierMaking machinelearningeasier
Making machinelearningeasierDev Raj Gautam
 
Recommender System Using AZURE ML
Recommender System Using AZURE MLRecommender System Using AZURE ML
Recommender System Using AZURE MLDev Raj Gautam
 
From c# Into Machine Learning
From c# Into Machine LearningFrom c# Into Machine Learning
From c# Into Machine LearningDev Raj Gautam
 
Machine Learning With ML.NET
Machine Learning With ML.NETMachine Learning With ML.NET
Machine Learning With ML.NETDev Raj Gautam
 

More from Dev Raj Gautam (7)

RED’S, GREEN’S & BLUE’S OF PROJECT/PRODUCT MANAGEMENT
RED’S, GREEN’S & BLUE’S  OF  PROJECT/PRODUCT MANAGEMENTRED’S, GREEN’S & BLUE’S  OF  PROJECT/PRODUCT MANAGEMENT
RED’S, GREEN’S & BLUE’S OF PROJECT/PRODUCT MANAGEMENT
 
Making machinelearningeasier
Making machinelearningeasierMaking machinelearningeasier
Making machinelearningeasier
 
Recommender System Using AZURE ML
Recommender System Using AZURE MLRecommender System Using AZURE ML
Recommender System Using AZURE ML
 
From c# Into Machine Learning
From c# Into Machine LearningFrom c# Into Machine Learning
From c# Into Machine Learning
 
Machine Learning With ML.NET
Machine Learning With ML.NETMachine Learning With ML.NET
Machine Learning With ML.NET
 
Intelligent bots
Intelligent botsIntelligent bots
Intelligent bots
 
SOA & WCF
SOA & WCFSOA & WCF
SOA & WCF
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

ASP.NET MVC Introduction & Guidelines

  • 2. Speaker Introduction Dev Raj Gautam Application & Database Specialist Nutrition Innovation Lab: Nepal Active Contributor @ASP.NET Community http://blogs.devgautam.com.np/ Have been in industry since 2009. Worked with government, local companies, outsourcing companies and Ingo's . ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 3. Agenda • Introduction to MVC • What Does MVC Offer? • Demo • Routing & Web API. • Web Forms Or MVC? ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 4. Introduction ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 5. Asp.Net MVC1 Released on Mar 13, 2009 ASP.NET Web Forms is not part of ASP.NET 5 ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 6. I was already there from 70’s MVC ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 7. MVC • Stands for Model View Controller. Common design pattern for • MVC is a software architectural pattern that follows the 'Separation of Concerns' principle. This principle divides an application into three interconnected parts as Model, View and Controller each with very specific set of responsibilities. The goal of this pattern is that each of these parts can be developed and tested in relative isolation and then combine together to create a very robust application. ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 8. Model-View-Controller • Model: These are the classes that contain data. They can practically be any class that can be instantiated and can provide some data. These can be entity framework generated entities, collection, generics or even generic collections too. • Controllers: These are the classes that will be invoked on user requests. The main tasks of these are to generate the model class object, pass them to some view and tell the view to generate markup and render it on user browser. • Views: The part of the application that handles user interaction. Typically controllers read data from a view, control user input, and send input data to the model. ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 9. How MVC Works? ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 10. What does MVC Offer? ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 11. Performance • ASP.NET MVC don’t have support for view state, so there will not be any automatic state management which reduces the page size and so gain the performance. ViewState ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 12. Separation Of Concern • When we talk about Views and Controllers, their ownership itself explains separation.The Views are just the presentation form of an application, it does not need to know specifically about the requests coming from the Controller. The Model is independent of Views and Controllers, it only holds business entities that can be ed to any View by the Controller as per the needs for exposing them to the end user. The Controller is independent of Views and Models, its sole purpose is to handle requests and them on as per the routes defined and as per the needs of the rendering Views. Thus our business entities (Model), business logic (Controllers) and presentation logic (Views) lie in logical/physical layers independent of each other. ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 13. Existing ASP.NET Features • ASP.NET MVC framework is built on top of matured ASP.NET framework and thus provides developer to use many good features such as forms authentication, windows authentication, caching, session and profile state management etc. ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 14. Parallel Development • In ASP.NET MVC layers are loosely coupled with each other, so one developer can work on Controller ,at the same time other on View and third developer on Model. This is called parallel development. ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 15. Full Control Over <HTML></HTML> • ASP.NET MVC doesn’t support server controls, only option available is using html input controls, so we will be sure about final html rendered at the end. We will also be aware about 'id' of every element. And so integration of ASP.NET MVC application with third party JavaScript libraries like jQuery becomes easy. ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 16. Testing • Asp.Net webforms is dependent on HttpContext.Current, our pages as part of the HttpApplication executing the request Which makes • These are all easily mockable! • HttpContextBase, HttpResponseBase, HttpRequestBase [TestMethod] public void ShowPostsDisplayPostView() { BlogController controller = new BlogController(…); var result = controller.ShowPost(2) as ViewResult; Assert.IsNotNull(result); Assert.AreEqual(result.ViewData["Message"], "Hello"); } ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 17. Testing • [TestMethod] • public void TestInvalidCredentials() • { • LoginController controller = new LoginController(); • var mock = new Mock<System.Web.Security.MembershipProvider>(); • mock.Expect(m => m.ValidateUser("", "")).Returns(false); • controller.MembershipProviderInstance = mock.Object; • var result = controller.Authenticate("", "") as ViewResult; • Assert.IsNotNull(result); • Assert.AreEqual(result.ViewName, "Index"); • Assert.AreEqual(controller.ViewData["ErrorMessage"], "Invalid credentials! Please verify your username and password."); • } ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 18. Clean URLS • ASP.NET MVC is so tightly integrated with the ASP.NET Routing engine, it is simple to take control over the URLs that your application exposes. Would you use: /Products.aspx?CategoryID={3F2504E0-4F89-11D3-9A0C-0305E82C3301} Or: /Products/Books SEO ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 19. Demo ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 20. What’s In Demo • Understanding the MVC Project Structure • Understanding and Modifying the Layout and Templeates • CRUD with project template • CRUD DIY with code • Basics of Routing • Basics of Web API ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 21. Routing & Web API ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 22. Routing • Routing maps request URL to a specific controller action using a Routing Table • Routing Engine uses routing rules that are defined in Global.asax file in order to parse the URL and find out the path of corresponding controller. ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 23. WEB API • Restful framework for Building HTTP Based services • What is Rest? “Rest is an architectural style that abstracts the architectural elements within a distributed hypermedia system” • https://api.twitter.com/1.1/statuses/retweets/2.json • Web API is not MVC ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 24. What In the World Is WCF Then? HUH!!!! ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 25. Use When? Web API • Only working with HTTP • Want RESTful endpoints • Don’t need multiple protocols • Don’t expose SOAP endpoints • Want Simple Configuration WCF • Needs to support multiple protocols • Need to expose SOAP endpoints • Need Complex Configuration • Need RPC Style Requests ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 26. Web Forms or MVC? ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 27. Web Forms or MVC? Web Froms • Winforms-alike event model • Familiar controls & Rich • Familiar = rapid application development • Functionality per page • Uses viewstate for state management • Less control over rendered HTML • Event Driven Programming • Oh wow! I can turn of or control View State Size. MVC • Less complex: separation of concerns • Easier parallel development • TDD support • No viewstate, … • Full control over behavior and HTML • Extensive Javascript • Makes you think ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 28. Web Forms or MVC? ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 29. Web Forms or MVC? • Mixing the Technologies can also do wonders for some solutions MVC Web Forms ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 30. Verdict? • Please decide on your own on the basis of previous slides. ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/
  • 31. Thank You ©Dev Raj Gautam, 2015, http://blogs.devgautam.com.np/

Editor's Notes

  1. In most cases, in order to get the page to execute correctly, you need to execute it in a real HttpContext. Since many of the properties of HttpContext are not settable (like Request and Response), it is extremely difficult to construct fake requests to send to your page objects. This makes unit testing webforms pages a nightmare, since it couples all your tests to needing all kinds of context setup.
  2. routes are configured on application start by calling a staticmethod "RegisterRoutes" in RouteConfig class. We can find RouteConfig.cs file under App_Start folder in ASP.NET MVC 5 application. 
  3. Rapid application development  go with asp.net Web Forms, Unit Testing - If automatic unit testing is most important factor for you MVC  Does your team have experience on ASP or non-Microsoft technologies such as android, ios, JSP, ROR, PHP? Is JavaScript going to be used extensively? Looking for good performance? Planning to reuse the same input logic?
  4. How to Use it? Add a reference to three core librares System.Web.Routing,System.Web.Abstractions, System.Web.MVC Add the controllers and view directories Update the Web.Config to load the three assemblies at runtime and registering the URLRewriting Module Registering the Routes in Global Asax Model.