SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
ASP.NET Core
Visual Studio 2017
White papers
By Hamida REBAI
Cross-Platform Framework
Goal
With this you will be able to understand ASP.NET
Core and Angular 2.0 to build powerful and
dynamic applications from the scratch and guide
you to cutting-edge web development.
Agenda
• .NET Core is ?
• Getting Ready
.NET Core is …
• A reimplementation of the .NET framework.
• Multi-platform, with applications that can be Written, compiled and executed on Windows, Linux and
MacOS.
• Open-source, hosted on GitHub and open to community contributions. (https://github.com/dotnet/core)
• Modular, where each API is distributed in an independent NuGet package.
• The ability to create MVC ASP sites and Web APIs
• Quick to get started with simple command-line utilities.
• Compatible with traditional .NET Framework and .NET Xamarin through .NET Standard.
• Powerful: .NET Core-based websites are faster than those based on the .NET Framework.
Getting Ready
Windows
• Preparing the workspace
Download Visual Studio 2017
.NET Core tools are included in Visual Studio 2017..NET Core for Visual
https://www.visualstudio.com/thank-you-downloading-visual-
studio/?sku=community
Install the .NET Core workload
Make sure you installed the workload ".NET Core cross-platform development". You
can check and install workloads by launching the Visual Studio Installer.
Getting Ready
MacOS
Preparing the workspace
Install Pre-requisites
• Homebrew and OpenSSL
After installing brew, do the following:
.NET Core SDK for OS X
https://go.microsoft.com/fwlink/?linkid=843444
Getting Ready
Linux
• Set up the apt-get that hosts the packages
• Install .NET Core SDK
• Introduction to the .NET CLI
• Test that you have you .NET installed by going to command line or
terminal and typing :
 dotnet
https://www.microsoft.com/net/core#linuxredhat
Getting Ready
• Install JavaScript runtime
built NodeJs.js
• https://nodejs.org/en/
Setting up the project
• Open Visual Studio 2017, Click on File / New / Project and select the
project template Visual C# / .NET Core / Console App (.NET Core).
• From the Templates tree, expand the Visual C# node and select the
Web
• subfolder: the right section of the modal window will be populated by
a number
• of available project templates
Setting up the project
Setting up the project
• Select the ASP.NET Core Web Application (.NET Framework) template
and fill in the relevant Name, Location, and Solution name fields.
• In the next modal window, we can further customize our template by
choosing the default contents to include in our project (Empty, Web
API, or Web Application) and the authentication mechanism, should
we want to use one.
• Choose Web API and No authentication, then click the OK button to
create the project.
Package and resource managers
• In Visual studio 2015:
• The solution's projects are now
created in a /src/ folder by default.
This is just a convention, though, as
they can be placed anywhere.
• There is a new folder called
wwwroot, which will contain the
compiled, ready-to publish
contents of our application, while
everything else will be the project
source code.
Package and resource managers
• In Visual studio 2017:
• The solution's projects are now
anymore created in a /src/ folder, it’s
like before under the project
directory. Different.
• There is a new folder called wwwroot,
which will contain the compiled,
ready-to publish contents of our
application, while everything else will
be the project source code. The
same.
• Dependencies are the References
used in our project and it’s ordered by
SDK and Nuget.
Package and resource managers
• Startup.cs
• This class was introduced in OWIN-based applications to replace most
of the tasks previously was handled in Global.asax.
• In ASP.NET Core this class serve for the same role, it is the place
where we can add services, choose which application modules and
middleware functions to load, handle dependency injection tasks, and
configure the pipeline.
• Gloabal.asax of today named Startup.cs has been completely
rewritten to be as pluggable and lightweight as possible, meaning
that it will include and load only what's strictly necessary to fulfill our
application's tasks.
Testing the HTTP request pipeline
• If we run our application again, we should now be welcomed with the
following:
Adding Angular 2
• For new project
• Create JavaScript Services project
Adding Angular 2
Launch angular project
• If you have already a project you can force the creation like this :
• dotnet new angular –all
PrimeNG
• PrimeNG is a collection of rich UI components for Angular 2. PrimeNG
is a sibling of the popular JavaServer Faces Component Suite,
PrimeFaces.
Add PrimeNG - package.json
Add PrimeNG – webpack.config.vendor.js
Add PrimeNG – webpack.config.vendor.js
PrimeNg does not support pre-rendering so
in ..ViewsHomeIndex.cshtml, change:
<app asp-prerender-
module="ClientApp/dist/main-
server">Loading...</app>
to:
<app>Loading...</app>
Install webpack
• npm install -g webpack
Update webpack.config.vendor.js
• We modified the webpack.config.vendor.js file (to add PrimeNg and
Font Awesome) but it is not updated by the classic build process.
• So, We have to run its configuration manually whenever we alter it.
• In a command prompt, at the project root, run:
• webpack --config webpack.config.vendor.js
Add new page HTML
• Create a folder called prime in the components folder and add the
following code to
..ClientAppappcomponentsprimeprime.component.html:
Add new TS file
• Create the file and add the following code to
..ClientAppappcomponentsprimeprime.component.ts:
Update app.module.ts
Update the file at: ..ClientAppappapp.module.ts to add:
Update navmenu.component.html
• Add the following code to
..ClientAppappcomponentsnavmenunavmenu.component.html:
Launch Prime part
White Paper : ASP.NET Core AngularJs 2 and Prime

Contenu connexe

Tendances

Tendances (20)

Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
 
SPSNL16 - Building Office 365 and SharePoint solutions using modern developer...
SPSNL16 - Building Office 365 and SharePoint solutions using modern developer...SPSNL16 - Building Office 365 and SharePoint solutions using modern developer...
SPSNL16 - Building Office 365 and SharePoint solutions using modern developer...
 
Lightning Web Component - LWC
Lightning Web Component - LWCLightning Web Component - LWC
Lightning Web Component - LWC
 
SharePoint Framework
SharePoint FrameworkSharePoint Framework
SharePoint Framework
 
1. deploying an asp.net web application
1. deploying an asp.net web application1. deploying an asp.net web application
1. deploying an asp.net web application
 
Building solutions with the SharePoint Framework - introduction
Building solutions with the SharePoint Framework - introductionBuilding solutions with the SharePoint Framework - introduction
Building solutions with the SharePoint Framework - introduction
 
ECS19 Elio Struyf - Setting Up Your SPFx CI/CD pipelines on Azure DevOps
ECS19 Elio Struyf - Setting Up Your SPFx CI/CD pipelines on Azure DevOpsECS19 Elio Struyf - Setting Up Your SPFx CI/CD pipelines on Azure DevOps
ECS19 Elio Struyf - Setting Up Your SPFx CI/CD pipelines on Azure DevOps
 
ASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTMASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTM
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
 
IVY: an overview
IVY: an overviewIVY: an overview
IVY: an overview
 
Supercharge Your SharePoint Framework Webpart with React
Supercharge Your SharePoint Framework Webpart with ReactSupercharge Your SharePoint Framework Webpart with React
Supercharge Your SharePoint Framework Webpart with React
 
Blazor and Azure Functions - a serverless approach
Blazor and Azure Functions - a serverless approachBlazor and Azure Functions - a serverless approach
Blazor and Azure Functions - a serverless approach
 
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin TimmermannO365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
ASP.NET Core 1.0 Overview
ASP.NET Core 1.0 OverviewASP.NET Core 1.0 Overview
ASP.NET Core 1.0 Overview
 
Developing a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2IDeveloping a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2I
 
Angular4 getting started
Angular4 getting startedAngular4 getting started
Angular4 getting started
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 

En vedette (6)

Certification Digital Active
Certification Digital ActiveCertification Digital Active
Certification Digital Active
 
C# Fundamentals for Absolute Beginners
C# Fundamentals for Absolute BeginnersC# Fundamentals for Absolute Beginners
C# Fundamentals for Absolute Beginners
 
Anteproyecto. grupo 102058-140.
Anteproyecto. grupo 102058-140.Anteproyecto. grupo 102058-140.
Anteproyecto. grupo 102058-140.
 
Pitch AlloTabib
Pitch AlloTabibPitch AlloTabib
Pitch AlloTabib
 
Présentation- Communauté
Présentation- CommunautéPrésentation- Communauté
Présentation- Communauté
 
Azure IOT: EVENT HUB & STREAM ANALYTICS & POWER BI
 Azure IOT: EVENT HUB & STREAM ANALYTICS & POWER BI Azure IOT: EVENT HUB & STREAM ANALYTICS & POWER BI
Azure IOT: EVENT HUB & STREAM ANALYTICS & POWER BI
 

Similaire à White Paper : ASP.NET Core AngularJs 2 and Prime

Rongde Qiu-DDsmile-2015.1.25
Rongde Qiu-DDsmile-2015.1.25Rongde Qiu-DDsmile-2015.1.25
Rongde Qiu-DDsmile-2015.1.25
Rongde Qiu
 
ABP.pptx
ABP.pptxABP.pptx
ABP.pptx
Imdad Ullah
 

Similaire à White Paper : ASP.NET Core AngularJs 2 and Prime (20)

Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA Templates
 
ASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bitsASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bits
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Mini-Training Owin Katana
Mini-Training Owin KatanaMini-Training Owin Katana
Mini-Training Owin Katana
 
Rongde Qiu-DDsmile-2015.1.25
Rongde Qiu-DDsmile-2015.1.25Rongde Qiu-DDsmile-2015.1.25
Rongde Qiu-DDsmile-2015.1.25
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)
 
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
Rome .NET Conference 2024 - Remote Conference
Rome .NET Conference 2024  - Remote ConferenceRome .NET Conference 2024  - Remote Conference
Rome .NET Conference 2024 - Remote Conference
 
Murach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMurach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVC
 
.Net framework vs .net core a complete comparison
.Net framework vs .net core  a complete comparison.Net framework vs .net core  a complete comparison
.Net framework vs .net core a complete comparison
 
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
 
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
.Net Core
.Net Core.Net Core
.Net Core
 
ABP.pptx
ABP.pptxABP.pptx
ABP.pptx
 
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...
Asp. net core 3.0  build modern web and cloud applications (top 13 features +...Asp. net core 3.0  build modern web and cloud applications (top 13 features +...
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...
 
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
Top 8 Reasons ASP.NET Core is the Best Framework for Web Application Developm...
 
Porting Projects to .NET 5
Porting Projects to .NET 5Porting Projects to .NET 5
Porting Projects to .NET 5
 

Plus de Hamida Rebai Trabelsi

Preparing for Exam MTA 98-375 HTML5 App Development
Preparing for Exam MTA 98-375 HTML5 App DevelopmentPreparing for Exam MTA 98-375 HTML5 App Development
Preparing for Exam MTA 98-375 HTML5 App Development
Hamida Rebai Trabelsi
 
Microsoft Azure Fundamentals Websites
Microsoft Azure Fundamentals WebsitesMicrosoft Azure Fundamentals Websites
Microsoft Azure Fundamentals Websites
Hamida Rebai Trabelsi
 
Creating Dynamic Webpages with Knockout
Creating Dynamic Webpages with KnockoutCreating Dynamic Webpages with Knockout
Creating Dynamic Webpages with Knockout
Hamida Rebai Trabelsi
 

Plus de Hamida Rebai Trabelsi (20)

APIs In Action -Harnessing the Power of Azure API Management: Building Robust...
APIs In Action -Harnessing the Power of Azure API Management: Building Robust...APIs In Action -Harnessing the Power of Azure API Management: Building Robust...
APIs In Action -Harnessing the Power of Azure API Management: Building Robust...
 
Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...
Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...
Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...
 
Streamlining Workflows: Unleashing Automation with Azure and Power Automate
Streamlining Workflows: Unleashing Automation with Azure and Power AutomateStreamlining Workflows: Unleashing Automation with Azure and Power Automate
Streamlining Workflows: Unleashing Automation with Azure and Power Automate
 
Configurer GitHub Actions avec Docker et DotNET 8.pdf
Configurer GitHub Actions avec Docker et DotNET 8.pdfConfigurer GitHub Actions avec Docker et DotNET 8.pdf
Configurer GitHub Actions avec Docker et DotNET 8.pdf
 
Build containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdfBuild containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdf
 
Conteneuriser une application .NET 8 en utilisant Docker et Azure.pdf
Conteneuriser une application .NET 8 en utilisant Docker et Azure.pdfConteneuriser une application .NET 8 en utilisant Docker et Azure.pdf
Conteneuriser une application .NET 8 en utilisant Docker et Azure.pdf
 
TechDayConf Edition 1 - 2020
TechDayConf Edition 1 -  2020TechDayConf Edition 1 -  2020
TechDayConf Edition 1 - 2020
 
Les nouveautés de Xamarin et Visual Studio App Center
Les nouveautés de Xamarin et Visual Studio App CenterLes nouveautés de Xamarin et Visual Studio App Center
Les nouveautés de Xamarin et Visual Studio App Center
 
Xamarin notes- en français
Xamarin notes- en françaisXamarin notes- en français
Xamarin notes- en français
 
Advices before starting a project
Advices before starting a projectAdvices before starting a project
Advices before starting a project
 
Resume-REBAI.json
Resume-REBAI.jsonResume-REBAI.json
Resume-REBAI.json
 
Detailed-Resume-Rebai-Hamida
Detailed-Resume-Rebai-HamidaDetailed-Resume-Rebai-Hamida
Detailed-Resume-Rebai-Hamida
 
CV REBAI Hamida
CV REBAI HamidaCV REBAI Hamida
CV REBAI Hamida
 
TechWadi-MENA-Guide-to-GES-2016-vf
TechWadi-MENA-Guide-to-GES-2016-vfTechWadi-MENA-Guide-to-GES-2016-vf
TechWadi-MENA-Guide-to-GES-2016-vf
 
Preparing for Exam MTA 98-375 HTML5 App Development
Preparing for Exam MTA 98-375 HTML5 App DevelopmentPreparing for Exam MTA 98-375 HTML5 App Development
Preparing for Exam MTA 98-375 HTML5 App Development
 
Microsoft Azure Fundamentals
Microsoft Azure FundamentalsMicrosoft Azure Fundamentals
Microsoft Azure Fundamentals
 
Microsoft Azure Fundamentals Websites
Microsoft Azure Fundamentals WebsitesMicrosoft Azure Fundamentals Websites
Microsoft Azure Fundamentals Websites
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Creating Dynamic Webpages with Knockout
Creating Dynamic Webpages with KnockoutCreating Dynamic Webpages with Knockout
Creating Dynamic Webpages with Knockout
 
Adding Style with CSS
Adding Style with CSSAdding Style with CSS
Adding Style with CSS
 

Dernier

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Dernier (20)

Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 

White Paper : ASP.NET Core AngularJs 2 and Prime

  • 1. ASP.NET Core Visual Studio 2017 White papers By Hamida REBAI Cross-Platform Framework
  • 2. Goal With this you will be able to understand ASP.NET Core and Angular 2.0 to build powerful and dynamic applications from the scratch and guide you to cutting-edge web development.
  • 3. Agenda • .NET Core is ? • Getting Ready
  • 4. .NET Core is … • A reimplementation of the .NET framework. • Multi-platform, with applications that can be Written, compiled and executed on Windows, Linux and MacOS. • Open-source, hosted on GitHub and open to community contributions. (https://github.com/dotnet/core) • Modular, where each API is distributed in an independent NuGet package. • The ability to create MVC ASP sites and Web APIs • Quick to get started with simple command-line utilities. • Compatible with traditional .NET Framework and .NET Xamarin through .NET Standard. • Powerful: .NET Core-based websites are faster than those based on the .NET Framework.
  • 5. Getting Ready Windows • Preparing the workspace Download Visual Studio 2017 .NET Core tools are included in Visual Studio 2017..NET Core for Visual https://www.visualstudio.com/thank-you-downloading-visual- studio/?sku=community Install the .NET Core workload Make sure you installed the workload ".NET Core cross-platform development". You can check and install workloads by launching the Visual Studio Installer.
  • 6. Getting Ready MacOS Preparing the workspace Install Pre-requisites • Homebrew and OpenSSL After installing brew, do the following: .NET Core SDK for OS X https://go.microsoft.com/fwlink/?linkid=843444
  • 7. Getting Ready Linux • Set up the apt-get that hosts the packages • Install .NET Core SDK • Introduction to the .NET CLI • Test that you have you .NET installed by going to command line or terminal and typing :  dotnet https://www.microsoft.com/net/core#linuxredhat
  • 8. Getting Ready • Install JavaScript runtime built NodeJs.js • https://nodejs.org/en/
  • 9. Setting up the project • Open Visual Studio 2017, Click on File / New / Project and select the project template Visual C# / .NET Core / Console App (.NET Core). • From the Templates tree, expand the Visual C# node and select the Web • subfolder: the right section of the modal window will be populated by a number • of available project templates
  • 10. Setting up the project
  • 11. Setting up the project • Select the ASP.NET Core Web Application (.NET Framework) template and fill in the relevant Name, Location, and Solution name fields. • In the next modal window, we can further customize our template by choosing the default contents to include in our project (Empty, Web API, or Web Application) and the authentication mechanism, should we want to use one. • Choose Web API and No authentication, then click the OK button to create the project.
  • 12.
  • 13.
  • 14.
  • 15. Package and resource managers • In Visual studio 2015: • The solution's projects are now created in a /src/ folder by default. This is just a convention, though, as they can be placed anywhere. • There is a new folder called wwwroot, which will contain the compiled, ready-to publish contents of our application, while everything else will be the project source code.
  • 16. Package and resource managers • In Visual studio 2017: • The solution's projects are now anymore created in a /src/ folder, it’s like before under the project directory. Different. • There is a new folder called wwwroot, which will contain the compiled, ready-to publish contents of our application, while everything else will be the project source code. The same. • Dependencies are the References used in our project and it’s ordered by SDK and Nuget.
  • 17. Package and resource managers • Startup.cs • This class was introduced in OWIN-based applications to replace most of the tasks previously was handled in Global.asax. • In ASP.NET Core this class serve for the same role, it is the place where we can add services, choose which application modules and middleware functions to load, handle dependency injection tasks, and configure the pipeline. • Gloabal.asax of today named Startup.cs has been completely rewritten to be as pluggable and lightweight as possible, meaning that it will include and load only what's strictly necessary to fulfill our application's tasks.
  • 18. Testing the HTTP request pipeline • If we run our application again, we should now be welcomed with the following:
  • 19. Adding Angular 2 • For new project • Create JavaScript Services project
  • 21. Launch angular project • If you have already a project you can force the creation like this : • dotnet new angular –all
  • 22. PrimeNG • PrimeNG is a collection of rich UI components for Angular 2. PrimeNG is a sibling of the popular JavaServer Faces Component Suite, PrimeFaces.
  • 23. Add PrimeNG - package.json
  • 24. Add PrimeNG – webpack.config.vendor.js
  • 25. Add PrimeNG – webpack.config.vendor.js PrimeNg does not support pre-rendering so in ..ViewsHomeIndex.cshtml, change: <app asp-prerender- module="ClientApp/dist/main- server">Loading...</app> to: <app>Loading...</app>
  • 26. Install webpack • npm install -g webpack
  • 27. Update webpack.config.vendor.js • We modified the webpack.config.vendor.js file (to add PrimeNg and Font Awesome) but it is not updated by the classic build process. • So, We have to run its configuration manually whenever we alter it. • In a command prompt, at the project root, run: • webpack --config webpack.config.vendor.js
  • 28. Add new page HTML • Create a folder called prime in the components folder and add the following code to ..ClientAppappcomponentsprimeprime.component.html:
  • 29. Add new TS file • Create the file and add the following code to ..ClientAppappcomponentsprimeprime.component.ts:
  • 30. Update app.module.ts Update the file at: ..ClientAppappapp.module.ts to add:
  • 31. Update navmenu.component.html • Add the following code to ..ClientAppappcomponentsnavmenunavmenu.component.html: