This document provides an overview of ASP.NET, including its history, the MVC pattern, routing, controllers, models, views, and filters. It discusses ASP.NET MVC and Web API, comparing their concepts. Finally, it briefly introduces ASP.NET 5 and some of its key differences from earlier ASP.NET versions like the removal of Web Forms and integration of MVC and Web API into a single framework.
Mobile applications Development - Lecture 12
Javascript
jQuery (Zepto)
useful microframeworks
This presentation has been developed in the context of the Mobile Applications Development course at the Computer Science Department of the University of L’Aquila (Italy).
http://www.di.univaq.it/malavolta
Introduction to ASP.NET MVC, Covering following topics:
Asp.Net Webforms?
Web-Forms : Request Flow
Problems with Web-Forms Approach
Why does Microsoft need MVC?
What is MVC?
Asp.Net MVC Request Flow
Example
The REST Architectural Style
Resources
Representations
Actions
Security
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2014.
http://www.ivanomalavolta.com
Mobile applications Development - Lecture 12
Javascript
jQuery (Zepto)
useful microframeworks
This presentation has been developed in the context of the Mobile Applications Development course at the Computer Science Department of the University of L’Aquila (Italy).
http://www.di.univaq.it/malavolta
Introduction to ASP.NET MVC, Covering following topics:
Asp.Net Webforms?
Web-Forms : Request Flow
Problems with Web-Forms Approach
Why does Microsoft need MVC?
What is MVC?
Asp.Net MVC Request Flow
Example
The REST Architectural Style
Resources
Representations
Actions
Security
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2014.
http://www.ivanomalavolta.com
AngularJS 1.x - your first application (problems and solutions)Igor Talevski
We will talk about all aspects of building a single page application with AngularJS, and we will discuss real examples from day-to-day work. We will also cover a large amount of theory about general web development, best practices, and today's client demands. We will focus on three (3) main points: architecture, security, and real time notification.
JavaScript is a lightweight, interpreted programming language with object-oriented capabilities that allows you to build interactivity into otherwise static HTML pages.
AngularJS 1.x - your first application (problems and solutions)Igor Talevski
We will talk about all aspects of building a single page application with AngularJS, and we will discuss real examples from day-to-day work. We will also cover a large amount of theory about general web development, best practices, and today's client demands. We will focus on three (3) main points: architecture, security, and real time notification.
JavaScript is a lightweight, interpreted programming language with object-oriented capabilities that allows you to build interactivity into otherwise static HTML pages.
The first of its kind Web Technology Conference on Open Source Technology, WebOSS '07 was organised in Kolkata on Sat, 13th Oct 07 and I spoke at the event as one of the participants on "Building Applications using AJAX". Here I will share my presentation.
Anchor object
Document object
Event object
Form and Form Input object
Frame, Frameset, and IFrame objects
Image object etc
Dom hiearchy,managing events
onload and onunload
Using the Onclick Event Handler
If you are using jQuery, you need to understand the Document Object Model and how it accounts for all the elements inside any HTML document or Web page.
Introduction To Building Enterprise Web Application With Spring MvcAbdelmonaim Remani
This the perfect introduction for people who have absolutely no experience with the Spring framework. The session adopts a learn-by-example approach and takes the form of a practical hands-on-lab with a lot of live coding. Attendees will be presented with a sample web application and various use-case scenarios, they will build an actual Spring MVC web application backed by a MySQL database end-to-end, They will Test it, and deploy it on an Apache TomCat web server. The basics of the Spring framework, design patterns, and best practices will be picked up by example along the way. Covered topics include: Inversion of Control (Dependency Injection), Spring MVC, Spring DAO, Spring ORM (iBatis), Aspect Oriented Programming in Spring, Basic Web Security, and the Mail API. Bring your laptop! Prerequisites: Familiarity with the architecture of Java web application and its technologies (Servlets, JSP, Java EL, JSTL, etc... )
It tells about how dom really used in javascript & html.And it tells about its levels and its w3c standards. And some Dom example programs with source code and screenshots.
Building Web Application Using Spring FrameworkEdureka!
Spring is the most popular open source Java application Framework. Most of the existing frameworks like Struts or Hibernate take care of one layer or a part of the application development.
As Struts take care of MVC model, Hibernate provides ease of working with databases. However, Spring Framework combines all the industry standard framework approaches (e.g. Struts and Hibernate) into one bundle.
Spring provides Dependency Injection, Aspect Oriented Programming and support for unit testing. This gives the developer time to work on main business logic rather than worrying about non-application code. Spring makes the application development fast and increases the productivity of developers.
The ASP.NET MVC Framework provides a powerful Model View Controller (MVC) approach to building web applications and provides separation of concerns, control over HTML output, intuitive URLs, and increased testability. We will start by looking at the -what and why of ASP.NET MVC. Then we will explore the various pieces of ASP.NET MVC including routes, controllers, actions, and views. If you are looking to get started with MVC then don’t miss this session.
ASP.NET MVC_Routing_Authentication_Aurhorization.pdfsetit72024
Introduction:
Begin with an overview of the .NET MVC framework and its importance in building dynamic and scalable web applications.
Introduce the key concepts that will be covered in the presentation: Attribute Routing, Authentication, and Authorization.
Highlight the significance of these features in enhancing the security, usability, and structure of MVC applications.
Section 1: Attribute Routing in .NET MVC:
Definition and Purpose:
Define Attribute Routing and explain its role in defining routes using attributes directly within the controller and action methods.
Emphasize the benefits of attribute routing in terms of readability, maintainability, and providing fine-grained control over URL patterns.
Syntax and Examples:
Provide examples of attribute routing syntax within controllers and actions.
Demonstrate how attribute routing allows developers to create custom, SEO-friendly, and RESTful URLs.
Showcase scenarios where attribute routing excels over convention-based routing.
Section 2: Authentication in .NET MVC:
Understanding Authentication:
Define Authentication and discuss its importance in verifying the identity of users accessing an application.
Introduce the authentication mechanisms supported by .NET MVC, such as Forms Authentication, Windows Authentication, and OAuth.
Implementing Authentication:
Walk through the process of implementing authentication in .NET MVC using attributes, filters, and middleware.
Discuss the role of the [Authorize] attribute and how it restricts access to specific controllers or actions based on the user's authentication status.
Section 3: Authorization in .NET MVC:
Overview of Authorization:
Define Authorization and distinguish it from authentication.
Emphasize the significance of controlling access to specific resources based on user roles, claims, or other criteria.
Implementing Authorization:
Discuss how authorization can be implemented in .NET MVC using attributes like [Authorize] and [AllowAnonymous].
Explore scenarios where role-based authorization and custom policies are essential.
Provide examples of how to implement role-based access control and attribute-based access control.
Case Studies and Best Practices:
Present real-world case studies or examples showcasing the effective use of attribute routing, authentication, and authorization in .NET MVC projects.
Share best practices for maintaining a secure and well-structured MVC application, including tips on managing user roles, securing sensitive data, and handling authentication cookies.
Conclusion:
Summarize the key takeaways from the presentation.
Reinforce the importance of attribute routing, authentication, and authorization in building robust and secure .NET MVC applications.
Encourage further exploration through resources, documentation, and community forums.
ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.
A simple presentation to understand what is ASP.net MVC4 and its structure.It covers all important features of MVC4 and razor view engine including screenshots
(ATS6-DEV03) Building an Enterprise Web Solution with AEPBIOVIA
In this session, we'll take a deep dive into building an Enterprise Solution with AEP. We'll be using Pipeline Pilot to develop the protocols that will provide our server-side implementations and ExtJS to build the user interface. We'll look at the techniques involved in using protocols to implement actions and explore the capabilities of ExtJS to produce powerful enterprise applications.
Sitecore is making a move: the shift from Sitecore's web forms to Sitecore MVC has been a gradual one, but it's ramping up quickly. Stay in the know with this primer on what it is and why it's important
Getting started with MVC 5 and Visual Studio 2013Thomas Robbins
The ASP.NET MVC Framework provides a powerful Model View Controller (MVC) approach to building web applications and provides separation of concerns, control over HTML output, intuitive URLs, and increased testability. We will start by looking at the what and why of ASP.NET MVC. Then we will explore the various pieces of ASP.NET MVC including routes, controllers, actions, and views. If you are looking to get started with MVC then don’t miss this session.
Asp.NET Core is a cross-platform, high-performance, open-source framework for building modern, cloud-based, Internet-connected applications. With asp.NET Core, you can: Build web apps and services, IoT apps, and mobile backends; Use your favorite development tools on Windows, macOS, and Linux; Deploy to the cloud or on-premises; Run on .NET Core or .NET Framework. Millions of developers have used (and continue to use) asp.NET 4.x to create web apps. In this presentation we are going to talk about real time apps using these technology. Asp.NET Core
Managing data is difficult and sometimes handling JSON APIs can get confusing. Figuring out endpoints is stressful. GraphQL is here to change that. GraphQL is a query language that can be implemented in whichever programming language you want. Thanks to it, we can use a single endpoint to exchange data. Choose your data! No overfetching! In this workshop we will learn all about GraphQL by building an application from the server to the client using JavaScript.
The computer is not a luxury but a necessity in today’s world. The computer has now become a personal computer with the introduction of micro controllers and integrated circuits. Raspberry Pi is a credit-card sized computer aimed at providing a computer to everyone on the planet. It is aimed at teaching computer concepts while being low at price. Raspberry Pi is intended to provide a base on which everyone can learn programming while enthusiasts can make various projects. It serves as an efficient base due to its low cost and the number of interfaces available. The Raspberry Pi can be used instead of a personal computer, but with some limitations due to its limited processing power Arduino is an open source platform that offers a clear and simple environment for physical computing. It is now widely used in modern robotics and IoT applications, because its low cost, ease of programming and rapid prototyping capabilities.
From biological to artificial neurons. An Artificial Neural Network (ANN) is an information processing paradigm that is inspired by the way biological nervous systems, such as the brain, process information. The key element of this paradigm is the novel structure of the information processing system.
To learn the basics of neural networks on this workshop we sill explain one of it implement in python. During the workshop we will explain also the script which are the layers processing unit and they function using simply matrix operation such as Hadammard or Dot product. Basic features such as learning modifier (alpha) and bias units are implemented as well..
WordPress is a free and open-source content management system based on PHP and MySQL. More than 30% of the websites in world use wordpress as CMS. Due to its high usage, it has a lot of themes and plugins which update very often. What if these updates are not good for us? In this presentation we will learn how to keep WordPress and its themes up to date but also to keep our design and functionality up and running without loosing the custom modifications we have made.
Magento is one of the most powerful eCommerce platforms on the market. With it’s well-designed, open-source codebase, and modular structure. Business owners an opportunity to expand their business operations in the digital e-commerce world. It's a powerful system, flexible, scalable and easy to customize. New features in Magento can be added by creating custom modules, thus providing unlimited possibilities to customize an online store. For this presentation we are going to talk for differences between Magento and other ecommerce platforms on the market, Magento 1 vs Magento 2, Magento 2 installation under LAMP, and we are going to build CRUD module for demonstrating how Magento 2 works from the developer.
In today’s Digital Era people’s requests and usage of applications or services are quite high. Everybody is connected with anybody. Waiting time to use a service is rapidly moving toward zero. Hence modern applications should deal with higher expectations than ever in order to be successful. Developers should be able to develop and deploy modern applications matching expectations in the quickest time possible without sacrificing quality of their applications. In this presentation we are going to demonstrate some of the tools that facilitates development and deployment time for applications, thus making developers life easier.
Design pattern is a description or template for how to solve a problem that can be used in many different situations. Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.
Starting with that principles of design patterns and ending by giving you the chance to design you own pattern. - Don't lose your pattern.
What is a Blockchain?
Why do we need such technology? What can it do for us…
How does Blockchain work…
Python Implementation of a Blockchain.
Intro to IBM Hyperledger.
Use case scenarios and real world usage, besides digital money .
Is it really easy to create a SPA? We will see the speed of development through Laravel and Angular, two frameworks that have revolutionized the web. Creating SPA has never been so simple.
Speaker: Shaban Ramadani - Team leader Commit Software
Agenda:
- Company presentation - Commit Software
- Topic:
- What are Laravel and Angular
- Laravel structure
- MVC Pattern in Laravel
- Simple API-s and testing them
- Having a big picture at Angular
- Demo and coding examples
- Introduction to the basic concepts of Arduino and Raspberry Pi, followed by a chronological timeline of different models of each of them.
-Pros and Cons.
-Automation of Raspberry Pi and Arduino in a single live demo.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...ssuser7dcef0
Power plants release a large amount of water vapor into the
atmosphere through the stack. The flue gas can be a potential
source for obtaining much needed cooling water for a power
plant. If a power plant could recover and reuse a portion of this
moisture, it could reduce its total cooling water intake
requirement. One of the most practical way to recover water
from flue gas is to use a condensing heat exchanger. The power
plant could also recover latent heat due to condensation as well
as sensible heat due to lowering the flue gas exit temperature.
Additionally, harmful acids released from the stack can be
reduced in a condensing heat exchanger by acid condensation. reduced in a condensing heat exchanger by acid condensation.
Condensation of vapors in flue gas is a complicated
phenomenon since heat and mass transfer of water vapor and
various acids simultaneously occur in the presence of noncondensable
gases such as nitrogen and oxygen. Design of a
condenser depends on the knowledge and understanding of the
heat and mass transfer processes. A computer program for
numerical simulations of water (H2O) and sulfuric acid (H2SO4)
condensation in a flue gas condensing heat exchanger was
developed using MATLAB. Governing equations based on
mass and energy balances for the system were derived to
predict variables such as flue gas exit temperature, cooling
water outlet temperature, mole fraction and condensation rates
of water and sulfuric acid vapors. The equations were solved
using an iterative solution technique with calculations of heat
and mass transfer coefficients and physical properties.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
5. ASP.NET MVC
• A new presentation option for ASP.NET
• Simpler way to program ASP.NET
• Easily testable and TDD friendly
• More control over your <html/>
• More control over your URLs
• Supports existing ASP.NET features
• Removes: viewstate and postback needs
7. Routing - example
public class OrdersController : Controller
{
public ActionResult Index()
{
}
public ActionResult Details(int id)
{
}
}
http://www.yoursite.com/Orders/Details/1
13. Controller
public class OrdersController : Controller
{
public ActionResult Details(int? id)
{
Order order = db.Orders.Find(id);
if (order == null)
return HttpNotFound();
return View(order);
}
}
View("MyWonderfulOrderView", order);
14. Controller – routing and HTTP methods
public class OrdersController : Controller
{
// GET: Orders/Edit/5
public ActionResult Edit(int? id)
{
}
// POST: Orders/Edit/5
[HttpPost]
public ActionResult Edit(Order order)
{
}
}
18. View
• Related to controllers/actions by naming convetion
• Several View Engine. Standard: Razor, WebFormViewEngine
• Support layouts and partial views
• Can use strongly-typed model (e.g. Order) or dynamic one (ViewBag)
• @Html helper methods (e.g. @Html.TextBoxFor)
• @Html methods can be extended
19. ActionResult
• ActionResult is the base class for action’s return types
• Available results:
• ViewResult - Renders a specifed view to the response stream
• RedirectResult - Performs an HTTP redirection to a specifed URL
• RedirectToRouteResult - Performs an HTTP redirection to a URL that is determined by
the routing engine, based on given route data
• JsonResult - Serializes a given ViewData object to JSON format
• ContentResult - Writes content to the response stream without requiring a view
• FileContentResult - Returns a file to the client
• and more
20. Model binder
• Transform values from client to .NET class instances or primitive types
• Retrieves values from HTML form variables, POSTed variables, query string
and routing parameters
• DefaultModelBinder is the default binder
• Binding can be customized, for specific types at application level or at action’s
parameter level
21. Filters
• Enable Aspect Oriented Programming (AOP)
• Different types for different needs:
• Authorization filters – IAuthorizationFilter
• Action filters – IActionFilter
• Result filters – IResultFilter
• Exception filters – IExceptionFilter
• Filters can be applied to a single action or a whole controller
23. ASP.NET Web API
• Formerly part of WCF framework
• 2012 – First release
• 2013 – Release of Web API 2
• First class framework for HTTP-based services
• Foundamental for creating RESTful services
• Self-hosted
• Different stacks, same concepts – System.Web.Mvc System.Web.Http
24. ASP.NET Web API cf. MVC
• Similar route patterns declarations
• Request/method name matching by HTTP verbs
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
25. ASP.NET Web API cf. MVC
GET http://www.yoursite.com/api/Orders/5
public class OrdersController : ApiController
{
IQueryable<Order> GetOrders() { … }
IHttpActionResult GetOrder(int id) { … }
IHttpActionResult PutOrder(int id, Order order) { … }
IHttpActionResult PostOrder(Order order) { … }
IHttpActionResult DeleteOrder(int id) { … }
}
26. ASP.NET Web API cf. MVC
• No views or ActionResult just data or IHttpActionResult
• Data are serialized in JSON or other format (e.g. XML)
• Controllers inherit from ApiController
• No more HttpContext.Current
• View filters
27. ASP.NET Web API - OData
“An open protocol to allow the creation and consumption of queryable and
interoperable RESTful APIs in a simple and standard way”
EnableQueryAttribute
Implements out of the box most of the OData query system: filters, pagination,
projection, etc.
31. ASP.NET 5 – .NET Core
• Totally modular
• Faster development cycle
• Seamless transition from on-premises to cloud
• Choose your editor and tools
• Open-source
• Cross-platform
• Fast
32. ASP.NET 5 cf. ASP.NET 4.X
• No more Web Forms and Web API only MVC
• One ring stack to rule them all, i.e. no more double coding
• Tag helpers – cleaner HTML views
• Project and configuration files in JSON
• Server side and client side packages completelly decoupled
• much more
33. thank you for your attention
stay tuned for next workshops
Andrea Vallotti, ph.D
andrea.vallotti@commitsoftware.it
Editor's Notes
1970s – First «implemetation»
1988 – Described as a pattern
several interpretations
mainly used in GUI
clear division between domain objects that model our perception of the real world, and presentation objects that are the GUI elements we see on the screen
one model – multiple views (even command line)
Given an URL, the routing engine is in charge of:
invoking the correct controller and method (called action);
parsing the parameters contained in it.
By naming convetion routing engine will look for a controller (i.e. a class) named OrdersController;
Then it will look for an action (i.e. a method) named Details;
Routing engine will also try to parse the URL looking for parameter which should be passed to
By naming convetion routing engine will look for a controller (i.e. a class) named OrdersController;
Then it will look for an action (i.e. a method) named Details;
Routing engine will also try to parse the URL looking for parameter which should be passed to
By naming convetion routing engine will look for a controller (i.e. a class) named OrdersController;
Then it will look for an action (i.e. a method) named Details;
Routing engine will also try to parse the URL looking for parameter which should be passed to
Standard way of defining routing convention/pattern;
Several definitions can be added;
Priority based on order;
Segment defaults or optional.
Highly customizable
Integrated with the "standard approach";
What is a controller:
it is a class which derives from Controller class;
it exposes public methods which return ActionResult or subclasses of the latter (see in detail later);
these methods are called actions;
Inside the action usually:
it gets a model and acts on it;
then select a View (by default the view has the same name of the action) and pass to it the model
Other ways to pass data to the View: ViewBag: dynamic, property of the controller
Stateless
As a rule of thumb actions name must be different even if signatures differ otherwise routing is not able to choose the correct method for a given URL
You can have more more methods with the same name by specifing the HTTP method:
AcceptVerbsAttribute
HttpDeleteAttribute
HttpGetAttribute
HttpHeadAttribute
HttpOptionsAttribute
HttpPatchAttribute
HttpPostAttribute
HttpPutAttribute
The Model of MVC is intended to be a "View Model" (example default UserLoginModel)
However also the Business Model can be used
You can use validation attribute to let MVC validate the user input
The Model of MVC is intended to be a "View Model" (example default LoginViewModel)
However also the Business Model can be used
You can use validation attribute to let MVC validate the user input
You can also use attribute to help rendering the view
System.ComponentModel.DataAnnotations
Helper, Bundle, etc.
By default all the views are placed in Views/<controller name>/<action name>.cshtml
Each project can use its preferred View Engine
There are also third-party View Engine which allow to use RoR or Django syntax
Layouts are like master pages in old ASP.NET
Different layouts can be used for different sections of the application (using Layout property)
Strongly-typed using @model directive, dynamic using ViewBag
ViewBag can be used by the View (even in strongly-typed) to pass information to the layout and partial views
Html helper methods can be used to render standard html elements
Helper, Bundle, etc.
Usually action’s return type is ActionResult but you can be more specific using a derived class
DefaultModelBinder creates an empty instance and fills it with values received from client
The default binder can be changed using ModelBinders.Binders.DefaultBinder
We will see a customization example during the demo
Filters are executed in the order listed
Authorization filters are used to implement authentication and authorization for controller actions
You can use an action filter, for instance, to modify the view data that a controller action returns.
Result filters - you might want to modify a view result right before the view is rendered to the browser.
You can use an exception filter to handle errors raised by either your controller actions or controller action results. You also can use exception filters to log errors.
System.Web.Mvc.FilterAttribute base class
WCF – Windows Communication Foundation is mainly aimed to SOAP-based services
ASP.NET MVC relies on IIS (standard or express) while ASP.NET Web API can be self-hosted
Routing - same declaration style, different classes
By default action are matched by HTTP verbs not segment of URL
GET http://www.yoursite.com/api/Orders/5 OrdersController.GetOrder(5)
Data are serialized in JSON or XML based on Accept header of HTTP request
Web API was design to work without a web server (i.e. IIS) and with async framework therefore you should never use HttpContext.Current especially when self-hosted
Web API is responsible to pass the correct context to each operation
Action, Authorization and Exception filters are still available
Basically OData is a way to standardize REST services, e.g. by defining how to filter
It is «simply» an action filter which works with an IQueryable
.NET Core 5:
is the version of .NET that runs on Mac, Windows and Linux;
brings features via packages framework much smaller;
ASP.NET 5 runs both on .NET Framework 4.6 and .NET Core;
Totally modular – cause all the library (such as MVC, file, etc.) have been stripped from the core you have to download them with NuGet
Faster development cycle – simply modify the code and refresh your page, the code will be automatically compiled
Seamless transition – the application runs with its own framework and libraries therefore you do not need to install «special» stuff on the server
Editor and tools – Visual Studio, Visual Studio Code on all platforms but through OmniaSharp also emacs, sublime, etc. are supported. Yeoman generator!!!
Cross-platform – Kestrel is a standalone web server based on libuv (the same as Node.JS),
Fast benchmarks show that ASP.NET 5 is faster than Node.JS
ASP.NET 5 only MVC which contains both old MVC and Web API
One stack one Controller base class, one routing configuration, model binding, etc.
All controllers can have actions which return ActionResult or data
System.Web.* does not exist anymore we have the package Microsoft.AspNet.Mvc
Tag helpers just like angular directive, allows to write more HTML and take advantage of intellisense for CSS and HTML
JSON files no more XML, JSON is easier to understand and widely used
Server/client side NuGet for the server and Bower for the client
Vi rigrazio per l’attenzione e spero di essere riuscito a sintetizzare un argomento che richiede molti approfondimenti.
Qui trovate i miei contatti e sono a disposizione al desk per un veloce incontro per rispondere a tutte le vostre domande.
Grazie ancora e buon forum a tutti.