SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Browser + Razor = Blazor
SPA with C# only
Robert Szachnowski
Agenda
2
1. History of client-side web development.
2. What is blazor? Framework’s features.
3. How blazor works – architecture.
4. C# vs AngularJS.
• AngularJS elements.
• Blazor’scomponent power.
• Components.
• Layouts.
5. Look in the code.
6. Materials.
History of client-side
web development
3
1 2 3
What is that Blazor?
4
Blazoris a single-page web app framework built on .NET that runs in the browser
with WebAssembly.Running .NET in the browser is made possibleby a relatively new
standardized web technology called WebAssembly.WebAssemblyis a "portable,
size- and load-time-efficient format suitable for compilation to the web." Code
compiled to WebAssemblycan run in any browser at native speeds.To run .NET
binaries in a web browser, we use a .NET runtime (specificallyMono) that has been
compiled to WebAssembly.
5
Blazor
Razor has its roots on the serverwhere it is
typically used to dynamically generate HTML. In
Blazor,Razor is used on the client. To be more
specific, the Razor engine runs during compilation
to generate C# Code from Razor templates.
6How is it compiled?
.cshtml example
Blazor features
7
• A component model
for building
composableUI
• Routing
• Layouts
• Forms and validation
• Dependency injection
• JavaScript interop
• Publishing and app
size trimming
• Livereloadingin the
browser during
development
• Server-siderendering
• Full .NET debuggingboth
in browsers and in the IDE
• Rich IntelliSenseand
tooling
• Abilityto run on older
(non-WebAssembly)
browsers via asm.js
Existing and planned
8
What dependencies are in the
browser?
9
BROWSER
Lorem
ipsum
Blazor &
Javascript
dependencies
Mono.js &
mono.wasm
runtime
Application
DLL’s in
IL code
Blazor workflow
10
11Example
C# vs AngularJS
Comparing Blazor features to Javascript
framework’s
13AngularJS elements
Comparing to list of many different
elements in the AngularJS framework,
creators of Blazor want to simplifythe
whole workflow, adjust to the .net world
and don’t make it the same as this
framework.
They want to make it better.
Source: https://www.slideshare.net/ThoughtWorks/angular-js-introduction-by-tania-gonzales
14Component power
Components
Components in Blazorare equivalent of controllers in the
AngularJS. Main difference is that to the component is
attached template which is „UI” for code.
„Components are flexibleand lightweight, and they can be
nested, reused,and shared between projects.”
We can cast our component in other templates as well. It
similar to directive in angularJS. The main difference in this
case is that components can be called only with specified
HTML tag and not like in the JS framework – as attributes of
HTML tag.
Component C# code can be nested in the template but can
be taken to the code-behind class as well. If we do this then
our class can be inherited in more than one template (if we
15
Layouts
Technically, a layout is just another Blazorcomponent.
A layout is defined in a Razor template or in C# code
and can contain data binding, dependencyinjection, and
other ordinary features of components. Two additional
aspects turn a component into a layout:
16
The layout component
must inherit from
BlazorLayoutComponen
t.
BlazorLayoutComponen
t defines a Body
property that contains
the content to be
@Body syntax located in
the template can allow
layout to be base layout for
components or layouts
(nesting).
Look in the code...
17
Source: https://github.com/rafek1241/blazor-first-approach
Thank you for reading
18
Materials that were used in this presentation:
- Blazor.net
- Learn-blazor.com
- Github.com/aspnet/Blazor
Resources:
- https://blazor.net/community.html

Weitere ähnliche Inhalte

Was ist angesagt?

Spring core module
Spring core moduleSpring core module
Spring core moduleRaj Tomar
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker, Inc.
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Herofazalraja
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerizationBalint Pato
 
GitOps A/B testing with Istio and Helm
GitOps A/B testing with Istio and HelmGitOps A/B testing with Istio and Helm
GitOps A/B testing with Istio and HelmWeaveworks
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basicsSourabh Saxena
 
Redux Toolkit - Quick Intro - 2022
Redux Toolkit - Quick Intro - 2022Redux Toolkit - Quick Intro - 2022
Redux Toolkit - Quick Intro - 2022Fabio Biondi
 
Introduction to Spring Cloud
Introduction to Spring Cloud           Introduction to Spring Cloud
Introduction to Spring Cloud VMware Tanzu
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - CoreDzmitry Naskou
 
Docker introduction
Docker introductionDocker introduction
Docker introductionPhuc Nguyen
 
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker, Inc.
 
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Edureka!
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerInstruqt
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersYajushi Srivastava
 

Was ist angesagt? (20)

Spring core module
Spring core moduleSpring core module
Spring core module
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Intro To Docker
Intro To DockerIntro To Docker
Intro To Docker
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 
Blazor
BlazorBlazor
Blazor
 
Blazor web apps
Blazor web appsBlazor web apps
Blazor web apps
 
Docker & Kubernetes intro
Docker & Kubernetes introDocker & Kubernetes intro
Docker & Kubernetes intro
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
GitOps A/B testing with Istio and Helm
GitOps A/B testing with Istio and HelmGitOps A/B testing with Istio and Helm
GitOps A/B testing with Istio and Helm
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
 
Redux Toolkit - Quick Intro - 2022
Redux Toolkit - Quick Intro - 2022Redux Toolkit - Quick Intro - 2022
Redux Toolkit - Quick Intro - 2022
 
Introduction to Spring Cloud
Introduction to Spring Cloud           Introduction to Spring Cloud
Introduction to Spring Cloud
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad
 
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 

Ähnlich wie Browser + Razor = Blazor SPA with C# only

9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To ChooseAlbiorix Technology
 
JavaScript - Kristiansand PHP
JavaScript - Kristiansand PHPJavaScript - Kristiansand PHP
JavaScript - Kristiansand PHPholeedave
 
AngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web ApplicationsAngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web ApplicationsIdexcel Technologies
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS FrameworkRaveendra R
 
What are razor pages?
What are razor pages?What are razor pages?
What are razor pages?Mindfire LLC
 
React.js alternatives modern web frameworks and lightweight java script libr...
React.js alternatives  modern web frameworks and lightweight java script libr...React.js alternatives  modern web frameworks and lightweight java script libr...
React.js alternatives modern web frameworks and lightweight java script libr...Katy Slemon
 
What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?Albiorix Technology
 
How to develop reusable components with Babel and Rollup.js
How to develop reusable components with Babel and Rollup.jsHow to develop reusable components with Babel and Rollup.js
How to develop reusable components with Babel and Rollup.jsHugo Magalhães
 
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
Fundamentals and Implementations of Angular JS with renowned Technology Platf...Fundamentals and Implementations of Angular JS with renowned Technology Platf...
Fundamentals and Implementations of Angular JS with renowned Technology Platf...OptiSol Business Solutions
 
Know the difference - Angular.js vs Node.js
Know the difference - Angular.js vs Node.jsKnow the difference - Angular.js vs Node.js
Know the difference - Angular.js vs Node.jsdenizjohn
 
.NET Fest 2018. Dino Esposito. ASP.NET Blazor—the C# Angular or the return of...
.NET Fest 2018. Dino Esposito. ASP.NET Blazor—the C# Angular or the return of....NET Fest 2018. Dino Esposito. ASP.NET Blazor—the C# Angular or the return of...
.NET Fest 2018. Dino Esposito. ASP.NET Blazor—the C# Angular or the return of...NETFest
 
A white paper on Fundamentals and Implementations of Angular JS
A white paper on Fundamentals and Implementations of Angular JSA white paper on Fundamentals and Implementations of Angular JS
A white paper on Fundamentals and Implementations of Angular JSOptiSol Business Solutions
 

Ähnlich wie Browser + Razor = Blazor SPA with C# only (20)

Javascript frameworks
Javascript frameworksJavascript frameworks
Javascript frameworks
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
 
9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose
 
Top 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web DevelopmentTop 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web Development
 
JavaScript - Kristiansand PHP
JavaScript - Kristiansand PHPJavaScript - Kristiansand PHP
JavaScript - Kristiansand PHP
 
Blazor.pptx
Blazor.pptxBlazor.pptx
Blazor.pptx
 
Angular Js
Angular JsAngular Js
Angular Js
 
AngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web ApplicationsAngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web Applications
 
What is mean stack?
What is mean stack?What is mean stack?
What is mean stack?
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS Framework
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
What are razor pages?
What are razor pages?What are razor pages?
What are razor pages?
 
React.js alternatives modern web frameworks and lightweight java script libr...
React.js alternatives  modern web frameworks and lightweight java script libr...React.js alternatives  modern web frameworks and lightweight java script libr...
React.js alternatives modern web frameworks and lightweight java script libr...
 
What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?
 
How to develop reusable components with Babel and Rollup.js
How to develop reusable components with Babel and Rollup.jsHow to develop reusable components with Babel and Rollup.js
How to develop reusable components with Babel and Rollup.js
 
Advantages of AngularJS
Advantages of AngularJSAdvantages of AngularJS
Advantages of AngularJS
 
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
Fundamentals and Implementations of Angular JS with renowned Technology Platf...Fundamentals and Implementations of Angular JS with renowned Technology Platf...
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
 
Know the difference - Angular.js vs Node.js
Know the difference - Angular.js vs Node.jsKnow the difference - Angular.js vs Node.js
Know the difference - Angular.js vs Node.js
 
.NET Fest 2018. Dino Esposito. ASP.NET Blazor—the C# Angular or the return of...
.NET Fest 2018. Dino Esposito. ASP.NET Blazor—the C# Angular or the return of....NET Fest 2018. Dino Esposito. ASP.NET Blazor—the C# Angular or the return of...
.NET Fest 2018. Dino Esposito. ASP.NET Blazor—the C# Angular or the return of...
 
A white paper on Fundamentals and Implementations of Angular JS
A white paper on Fundamentals and Implementations of Angular JSA white paper on Fundamentals and Implementations of Angular JS
A white paper on Fundamentals and Implementations of Angular JS
 

Kürzlich hochgeladen

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Kürzlich hochgeladen (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

Browser + Razor = Blazor SPA with C# only

  • 1. Browser + Razor = Blazor SPA with C# only Robert Szachnowski
  • 2. Agenda 2 1. History of client-side web development. 2. What is blazor? Framework’s features. 3. How blazor works – architecture. 4. C# vs AngularJS. • AngularJS elements. • Blazor’scomponent power. • Components. • Layouts. 5. Look in the code. 6. Materials.
  • 3. History of client-side web development 3 1 2 3
  • 4. What is that Blazor? 4 Blazoris a single-page web app framework built on .NET that runs in the browser with WebAssembly.Running .NET in the browser is made possibleby a relatively new standardized web technology called WebAssembly.WebAssemblyis a "portable, size- and load-time-efficient format suitable for compilation to the web." Code compiled to WebAssemblycan run in any browser at native speeds.To run .NET binaries in a web browser, we use a .NET runtime (specificallyMono) that has been compiled to WebAssembly.
  • 5. 5 Blazor Razor has its roots on the serverwhere it is typically used to dynamically generate HTML. In Blazor,Razor is used on the client. To be more specific, the Razor engine runs during compilation to generate C# Code from Razor templates.
  • 6. 6How is it compiled? .cshtml example
  • 7. Blazor features 7 • A component model for building composableUI • Routing • Layouts • Forms and validation • Dependency injection • JavaScript interop • Publishing and app size trimming • Livereloadingin the browser during development • Server-siderendering • Full .NET debuggingboth in browsers and in the IDE • Rich IntelliSenseand tooling • Abilityto run on older (non-WebAssembly) browsers via asm.js Existing and planned
  • 8. 8
  • 9. What dependencies are in the browser? 9 BROWSER Lorem ipsum Blazor & Javascript dependencies Mono.js & mono.wasm runtime Application DLL’s in IL code
  • 12. C# vs AngularJS Comparing Blazor features to Javascript framework’s
  • 13. 13AngularJS elements Comparing to list of many different elements in the AngularJS framework, creators of Blazor want to simplifythe whole workflow, adjust to the .net world and don’t make it the same as this framework. They want to make it better. Source: https://www.slideshare.net/ThoughtWorks/angular-js-introduction-by-tania-gonzales
  • 15. Components Components in Blazorare equivalent of controllers in the AngularJS. Main difference is that to the component is attached template which is „UI” for code. „Components are flexibleand lightweight, and they can be nested, reused,and shared between projects.” We can cast our component in other templates as well. It similar to directive in angularJS. The main difference in this case is that components can be called only with specified HTML tag and not like in the JS framework – as attributes of HTML tag. Component C# code can be nested in the template but can be taken to the code-behind class as well. If we do this then our class can be inherited in more than one template (if we 15
  • 16. Layouts Technically, a layout is just another Blazorcomponent. A layout is defined in a Razor template or in C# code and can contain data binding, dependencyinjection, and other ordinary features of components. Two additional aspects turn a component into a layout: 16 The layout component must inherit from BlazorLayoutComponen t. BlazorLayoutComponen t defines a Body property that contains the content to be @Body syntax located in the template can allow layout to be base layout for components or layouts (nesting).
  • 17. Look in the code... 17 Source: https://github.com/rafek1241/blazor-first-approach
  • 18. Thank you for reading 18 Materials that were used in this presentation: - Blazor.net - Learn-blazor.com - Github.com/aspnet/Blazor Resources: - https://blazor.net/community.html