Giter VIP home page Giter VIP logo

blazor-webassembly-by-example's Introduction

Blazor WebAssembly by Example

Blazor WebAssembly by Example

This is the code repository for Blazor WebAssembly by Example, published by Packt.

A project-based guide to building web apps with .NET, Blazor WebAssembly, and C#

What is this book about?

Blazor WebAssembly makes it possible to run C# code on the browser without having to use JavaScript, and does not rely on plugins or add-ons. The only technical requirement for using Blazor WebAssembly is to work with a browser that supports WebAssembly which, as of today, all modern browsers do

This book covers the following exciting features:

  • Discover the power of the C# language for both server-side and client-side web development
  • Use the Blazor WebAssembly App project template to build your first Blazor WebAssembly application
  • Use templated components and the Razor class library to build a modal dialog box
  • Understand how to use JavaScript with Blazor WebAssembly
  • Build a progressive web app (PWA) to enable native app-like performance and speed

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

@page "/{*path}"
<h1>Catch All</h1>
Route: @Path
@code {
    [Parameter] public string Path { get; set; }
}

Following is what you need for this book: This book is for .NET web developers who are tired of constantly learning new JavaScript frameworks and wish to write web applications using Blazor WebAssembly, leveraging the power of .NET and C#. The book assumes beginner-level knowledge of the C# language, .NET framework, Microsoft Visual Studio, and web development concepts.

With the following software and hardware list you can run all code files present in the book (Chapter 1-15).

Software and Hardware List

Chapter Software required OS required
1-9 visual Studio 2019 Community Edition Windows, Mac OS X, and Linux (Any)
8-9 SQL Server 2019 Express Edition Windows, Mac OS X, and Linux (Any)

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Code in Action

Click on the following link to see the Code in Action:

YouTube

Related products

Get to Know the Author

Toi B. Wright has been a Microsoft MVP in ASP.NET for 16 years and is also an ASP Insider. She is an experienced full-stack software developer, book author, courseware author, speaker, and community leader with over 25 years of experience. She has a BS in computer science and engineering from the Massachusetts Institute of Technology (MIT) and an MBA from Carnegie Mellon University (CMU).

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781800567511

blazor-webassembly-by-example's People

Contributors

keagancarneiro avatar packt-itservice avatar packtutkarshr avatar saurabhk710 avatar toiwright avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

blazor-webassembly-by-example's Issues

Comments

@ToiWright Hello,

I just finished your book. It is a really good book. The examples are excellent. Thank you very much.
I have a few minor comments to make, if you don't mind. I hope some of them make sense and can be useful.
I might suggest a PR for some of them if that would be helpful.

Functional point of view

  • Page 92. There is no indication of how to test the Resize. To see it in action, go to the /resize web page.
  • Page 98. What is the purpose of creating the interface for storage? It is not used afterwards.
    The best would be to add it as a service and then inject it on the index page. Or make a reference for chapter 6.
  • Page 142. If the PWA is opened from the Windows menu, the offline page is displayed.
  • Page 200. Sqlite could be proposed. It is easier to install.
  • Page 203. A few words about the importance of the @key could be added.
  • Page 207. Error information is never displayed on the Index page.
  • Page 214. There is no information about the fact that validation will not work for subclasses. Example: Customer.Address.City.
  • Page 214. Some references to validation libraries could be added. Example: Fluent Validation Library.
  • Page 228. There is no error test during HTTP communication.
  • Page 229. Error information is never displayed on the Index page.

Code

  • Page 123. Possible improvement for the javascript to get the message when the user has denied the access to geolocation.
if (navigator.geolocation) {
    try {
        var position = await getPositionAsync();
        var coords = {
            latitude: position.coords.latitude,
            longitude: position.coords.longitude
        };
        return coords;
    }
    catch (error) {
        throw error.message;
    }
  } else {
      throw Error("Geolocation is not supported by this browser.");
  };
protected override async Task OnInitializedAsync()
{
    try
    {
        await GetPositionAsync();
        await GetForecastAsync();
    }
    catch (JSException je)
    {
        message = je.Message;
    }
    catch (Exception ex)
    {
        message = ex.Message;
    }
}
  • Page 126. GetPosition could be renamed to GetPositionAsync.
  • Page 130. GetForecast could be renamed to GetForecastAsync.
  • Page 134. It should be in index.html for the link ... href="images/Sun-512.png" />.
  • Page 168. Modification for the code : @onclick="@(() => Console.WriteLine("Blazor rocks!"))".
  • Page 177. A check could be added if the delegate exists or not. if (OnDrop.HasDelegate).
  • Page 182. No need for @ in the case of taskName.
  • Page 182. OnClickHandler could be renamed to OnClickHandlerAsync.
  • Page 202. No need in the catch to have the word Exception.
  • Page 205. No need to have double parenthesis for the @ in the <span> section.
  • Page 207. CheckboxChecked could be renamed to CheckboxCheckedAsync. Same for DeleteTask and AddTask.
  • Page 208. Following code can be added when the task has been created.
    tasks.Where(x => x.TaskName == newTaskItem.TaskName).First().TaskItemId = task.TaskItemId;
  • Page 228. HandleValidSubmit method could be renamed to HandleValidSubmitAsync.
  • Page 229. No need to have a ready variable. A check can be made with expense == null.
  • Page 229. No need also for ; after }.

Topics that can be added to the book

  • Some words on <CascadingValue>.
  • Some words on @ref.
  • Some words about Container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.