0% found this document useful (0 votes)
2 views90 pages

IIT 10 Introduction

The document provides an introduction to ASP.NET Core MVC, explaining its architecture based on the model-view-controller (MVC) pattern, which separates application concerns for easier maintenance and testing. It also covers the evolution of ASP.NET, highlighting the transition from ASP.NET Web Forms to ASP.NET Core MVC, and discusses Visual Studio 2019 as a versatile IDE for various programming languages and platforms. Key features of Visual Studio 2019, such as improved installation processes, project creation, and IntelliCode for enhanced coding assistance, are also outlined.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views90 pages

IIT 10 Introduction

The document provides an introduction to ASP.NET Core MVC, explaining its architecture based on the model-view-controller (MVC) pattern, which separates application concerns for easier maintenance and testing. It also covers the evolution of ASP.NET, highlighting the transition from ASP.NET Web Forms to ASP.NET Core MVC, and discusses Visual Studio 2019 as a versatile IDE for various programming languages and platforms. Key features of Visual Studio 2019, such as improved installation processes, project creation, and IntelliCode for enhanced coding assistance, are also outlined.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 90

Introduction to

ASP.NET and
C#
1 ASP.NET Core
MVC
ASP.NET Core MVC
● ASP.NET Core MVC is a web application
development framework from Microsoft
that combines the effectiveness and
tidiness of model-view-controller (MVC)
architecture, ideas and techniques from
agile development, and the best parts of
the .NET platform.
3
What is model-view-controller
(MVC)?
● an architectural pattern that is widely used
in web development and user interface
design. It is a way of organizing code and
data into separate, but interconnected,
components. The goal of MVC is to
separate the concerns of an application, so
that it is easier to maintain, test, and
extend.
4
What is model-view-controller
(MVC)?
● Model: The model represents the data and
the business logic of the application. It is
responsible for retrieving and storing data,
as well as performing any necessary
calculations or processing.

5
What is model-view-controller
(MVC)?
● View: The view is responsible for
displaying the data to the user. It takes the
data from the model and presents it in a
format that is easy for the user to
understand, such as a web page.

6
What is model-view-controller
(MVC)?
● Controller: The controller is responsible
for handling user input and coordinating
the interactions between the model and the
view.

7
Understanding
the History of
ASP.NET Core
MVC
8
● The original ASP.NET was introduced in
2002, at a time when Microsoft was keen to
protect a dominant position in traditional
desktop application development and saw
the Internet as a threat.

9
10
ASP.NET Web Forms
● With Web Forms, Microsoft attempted to
hide both Hypertext Transfer Protocol
(HTTP), with its intrinsic statelessness, and
Hypertext Markup Language (HTML), which
at the time was unfamiliar to many
developers, by modeling the user interface
(UI) as a hierarchy of server-side control
objects.
11
ASP.NET Web Forms
● Each control kept track of its own state
across requests, rendering itself as HTML
when needed and automatically connecting
client-side events (for example, a button
click) with the corresponding server-side
event handler code.

12
ASP.NET Web Forms
● In effect, Web Forms is a giant abstraction
layer designed to deliver a classic event-
driven graphical user interface (GUI) over
the Web.
● The idea was to make web development
feel just the same as developing a desktop
application.
13
The Original MVC
Framework
● In October 2007, Microsoft announced a
new development platform, built on the
existing ASP.NET platform, that was
intended as a direct response to the
criticisms of Web Forms and the popularity
of competing platforms such as Ruby on
Rails.
14
The Original MVC
Framework
● The new platform was called the ASP.NET
MVC Framework and reflected the emerging
trends in web application development,
such as HTML and CSS standardization,
RESTful web services, effective unit testing,
and the idea that developers should
embrace the stateless nature of HTTP.
15
Understanding ASP.NET
Core
● In 2015, Microsoft announced a new
direction for ASP.NET and the MVC
Framework, which would event.ally produce
ASP.NET Core MVC.
● ASP.NET Core is built on .NET Core, which is
a cross-platform version of the .NET
Framework without the Windows-specific
application programming interfaces (APIs).
16
What is .NET Framework?
● .NET Framework is a development platform
that includes a Common Language
Runtime (CLR), which manages the
execution of code, and a Base Class
Library (BCL), which provides a rich
library of classes to build applications from.

17
The Common Language Runtime
(CLR)
● the virtual machine component of the .NET
Framework that manages the execution
of .NET applications. It provides a number
of services, such as memory management,
exception handling, and thread
management, that allow for the execution
of code written in any .NET-compatible
language.
18
Base Class Library (BCL)
● contains a wide range of functionality,
including collections, I/O, security,
globalization, and many other features that
are commonly used in .NET applications.

19
What is .NET Framework?
● CLR is the runtime environment that
manages the execution of .NET applications
and provides common services, while BCL
is a library of classes that provide
additional functionality for developers to
use in their applications.

20
Understanding ASP.NET
Core
● ASP.NET Core is a completely new
framework. It is simpler, it is easier to work
with, and it is free of the legacy that comes
from Web Forms. And, since it is based
on .NET Core, it supports the development
of web applications on a range of platforms
and containers.
21
Understanding ASP.NET
Core
● ASP.NET Core MVC provides the functionality
of the original ASP.NET MVC Framework built
on the new ASP.NET Core platform. It
integrates the features that were previously
provided by Web API, it includes a more
natural way of generating complex content,
and it makes key development tasks, such as
unit testing, simpler and more predictable.
22
2 Visual Studio
2019
Visual Studio 2019
● Visual Studio 2019 is the new IDE for
developers and was released by Microsoft on
2 April 2019.

● Focuses on building applications using C#,


VB.NET, F#, C++, Python, Java, Xamarin, and
more. In short, it is an IDE for every
developer who needs to build applications for
any platform. 24
Visual Studio 2019
● This IDE will help you to save time and effort
for all of the tasks that you want to complete
with your code, be it code navigation,
refactoring, code debugging, code fixes,
IntelliSense, code sharing with team
members, or unit testing your modules.

25
Visual Studio 2019
● Using Xamarin, you can build mobile
applications for Android, iOS, and Windows.
You can also build mobile apps with Visual C+
+ or Apache Cordov

26
Visual Studio 2019
● can also help you to streamline your real-
time architectural dependency validations
and provide you with stronger support for the
integration of source code repositories such
as GitHub and Azure DevOps.

27
The Visual Studio
2019 installation
experience

28
Visual Studio 2019
Installation
● With the launch of Visual Studio 2017,
Microsoft redesigned the Visual Studio
installation experience.

● beginning with Visual Studio 2017, no offline


installer is shipped out by Microsoft.

29
Visual Studio 2019
Installation
● You can install and run Visual Studio 2019 on
the following operating systems:
1. Windows 10 version 1703 or higher to build
apps for the Universal Windows Platform
(UWP).

2. Windows Server 2016 and Windows Server

2019
30
Visual Studio 2019
Installation
4. Windows Server 2012 R2 (with Update
2919355)
5. Windows 7 SP1 (with the latest Windows
Updates)

31
Visual Studio 2019
Installation
The following are the hardware requirements:
● You should have a 1.8 GHz or faster processor.
It's recommended to have a quad-core
processor or higher.
● You will need at least 2 GB of RAM, though
Microsoft recommends 8 GB of RAM. If you
want to run Visual Studio 2019 in a VM
system, a minimum of 2.5 GB of RAM is
recommended. 32
Visual Studio 2019
Installation
● You should have at least 800 MB HDD space
for a basic installation. The minimum space
can vary, depending on the workloads you
select.

● Visual Studio 2019 will work best at a


resolution of WXGA (1,366 by 768) or higher,
but you can install on a 1,280 by 720
resolution too. 33
Visual Studio 2019
Installation
● The new version of the installer that's used to
install Visual Studio 2017 or higher allows you
to control the individual workloads/modules
that you need.

● The Workloads screen will allow you to select


the module that you want to install.

34
35
Visual Studio 2019
Installation
● The main screen of the installer has four
different tabs: Workloads, Individual
Components, Language Packs, and Installation
locations.

36
37
Installing using the online
installer
● The Individual components tab lists all of the
components that are a part of individual
workloads, in categories. The components
part of the selected workloads will be auto-
checked by default. This is shown in the
following screenshot:

38
39
Installing using the online
installer
● The third tab is called Language packs and
allows you to choose the language that you
want to use with Visual Studio 2019.

● By default, it's the system default language,


which is English in my case; however, you can
opt for Chinese, French, German, or any other
language from the available list:
40
41
Installing using the online
installer
● By default, a file location is prepopulated for
the installer to install Visual Studio 2019, but
you can change it to a different folder if you
wish.
● The fourth tab, called Installation locations,
allows you to select the IDE installation path,
installation cache path, and shared
components path, as shown in the following
screenshot: 42
43
Installing using the online
installer
● There are three different editions available,
that is

1. Visual Studio Community Edition 2019,


2. Visual Studio Professional Edition 2019, and
3. Visual Studio Enterprise Edition 2019.

44
Visual Studio Community Edition
2019
● free, fully-featured IDE for students, open
source developers, and individual developers.

● In all these cases, you can create your own


free or paid apps using Visual Studio 2019
Community Edition.

45
Visual Studio Community Edition
2019
● Organizations will also be able to use the
Community Edition, but only under the
following conditions:

● In an enterprise organization, an
unlimited number of users can use the
Community Edition if they are using it in a
classroom learning environment, academic
research, or an open source project. 46
Visual Studio Community Edition
2019
An organization is defined as an
enterprise organization if they have more than
250 computers or one-million-dollar annual
revenue.

●In a non-enterprise organization, the


Community Edition is restricted to five
users.
47
Visual Studio Professional Edition
2019
● If you are a professional working within a
small team.

48
Visual Studio Enterprise
Edition 2019
● If you need to create an end-to-end solution
for a team of any size

49
Overview of the
new Start window

50
New Start window
● When you launch Visual Studio 2019, the new
Start window is the first thing that you will
see. It offers you a focused experience to get
you started with the IDE.

51
52
New Start window
● Two sections are available. The left-hand
section lists the recent activities and allows
you to open recent projects/solutions. It's the
most common way a developer opens the
code.

53
New Start window
● The right-hand section allows you to perform
some quick operations, such as cloning a
repository, opening an existing project or
solution, creating a new project, or opening
the IDE without using any code.

54
Cloning a Repository
● it's very easy to clone an existing source
control repository to a local path. You can
achieve this from the Start window.

● To begin, click on the Clone or check out code


navigation link, as shown in the following
screenshot:

55
Cloning a repository
● Once you hit the Clone button, the Visual
Studio 2019 IDE will be launched, and the
process to clone the code files will be
triggered. It will take some time, based on the
repository's size, to complete the process.

58
Opening an existing project or
solution
● Most of the time, a developer opens an
existing project that he/she is working on.

60
Opening an existing project or
solution
● Then, navigate through your local filesystem
and select the desired project/solution file to
open it.

62
Opening a local folder
● Though not a common thing to do, the Start
window allows you to open a local folder.

● This is often useful when you want to browse,


edit, build, and debug any code files that
don't have a project or solution file:

63
Creating a new project
● The Start window of Visual Studio 2019 also
allows you to directly create a project.

● The new project creation experience is fast


and easy enough to provide you with the right
project template so that you can begin writing
your code

65
Creating a new project
● The screen that follows will allow you to select
the project template.

● Based on the installed workload, the most


commonly used project type will be at the top
of the list.

67
Creating a new project
● You can also find a Most Recently Used (MRU)
list of recent project templates that you have
accessed and filter the templates based on
search terms, language, platform, and project
type.

68
Creating a new project
● Once you have selected the project template,
clicking on the Next button will navigate you
to a new screen, where you will be allowed to
set a name for the project and solution and
select the project's location.

70
Creating a new project
● It also provides you with the option to place
the project and solution in the same directory.

71
Improved search
in Visual Studio
2019

73
Search
● You may have already experienced the Visual
Studio quick launch bar for searching within
Visual Studio commands, menus, and so on.
With the release of Visual Studio 2019,
Microsoft has improved that search
experience.

● It now gives results faster and more


effectively. 74
Search
● For example, if you want to create a new WPF
project, enter wpf project in the search box.
This will display the available templates with
proper highlighting of the searched term, as
shown in the following screenshot:

75
Search
● Similarly, if you are looking for any settings
(let's say, themes), just enter the search term.
It will display the available settings:

77
Visual Studio
IntelliCode

79
Visual Studio IntelliCode
● Visual Studio IntelliCode is an artificial
intelligence (AI) assisted IntelliSense for Visual
Studio that enhances software development
by delivering context-aware code
completions.

80
Visual Studio IntelliCode
● IntelliCode suggestions appear at the top of
the completion list with a star icon next to
them, which gives you easy access to the APIs
within that context without scrolling through
the entire list.

81
Visual Studio IntelliCode
● Currently, the following languages are
supported by the IntelliCode feature: C#,
XAML, C++ (Preview), JavaScript, and
TypeScript (Preview).

82
Visual Studio IntelliCode
● There are around 2,000 open source projects
on GitHub, each of which has more than 100
stars to generate the recommendations for
Visual Studio IntelliCode.

● You need to train your IntelliCode model to get


the AI-assisted IntelliSense recommendations.

83
Installing the
IntelliCode
component

84
Installing the IntelliCode
component
● Visual Studio IntelliCode comes as a separate
component and is not part of any workload. To
install the component from the Visual Studio
2019 IDE, search for intellicode in the Quick
Search box, as shown in the following
screenshot:

85
Understanding
how IntelliCode
helps

87
how IntelliCode helps
● IntelliCode helps by adding context-aware
code completions to your project so that you
can focus on your code instead of searching
and scrolling through the IntelliSense menu. It
adds a * (star) symbol to the IntelliCode items,
as shown in the following screenshot

88
how IntelliCode helps
● In the preceding example, since we have
already inserted the if condition to check
whether the file exists, on the next line, it
adds common file operations such as Delete,
ReadAllText, OpenRead, and ReadAllLines to
the menu. Hence, common operations are
within your focus to select so that you
● can complete your code easily.
90

You might also like