Summary

In this module, you learned how to use Blazor components to handle UI events including how to set up two-way data bindings between UI elements and your code. You used what you learned to create a to-do list

oracle certification malaysia

Build a to-do list with Blazor

Learn how to build a to-do list with Blazor.

Learning objectives

In this module, you will:

  • Learn to handle events from components and set up two-way data bindings.
  • Create a to-do list page.

Prerequisites

  • Knowledge of what Blazor is and how it works at the beginner level
  • Basic knowledge of web app concepts
  • C# and .NET experience at the beginner level

This module is part of these learning paths

red hat certification malaysia

Build your first web app with Blazor

Learn how to build your first web app with Blazor.

Learning objectives

In this module, you will:

  • Configure your local environment for Blazor development.
  • Create a new Blazor web app project.
  • Add component logic to a Blazor web app.

Prerequisites

  • Knowledge of Blazor and how it works at the beginner level
  • Basic knowledge of web app concepts
  • C# and .NET experience at the beginner level

veeam certification malaysia

CRUD actions in ASP.NET Core

Our pizza service supports CRUD operations for a list of pizzas. These operations are performed through HTTP verbs, which are mapped via ASP.NET Core attributes. As you saw, the HTTP GET verb is used to retrieve one or more items from a service. Such an action is annotated with the [HttpGet] attribute.

The following table shows the mapping of the four operations that you’re implementing for the pizza service:

HTTP action verbCRUD operationASP.NET Core attribute
GETRead[HttpGet]
POSTCreate[HttpPost]
PUTUpdate[HttpPut]
DELETEDelete[HttpDelete]

You already saw how GET actions work. Let’s learn more about POSTPUT, and DELETE actions.

POST

To enable users to add a new item to the endpoint, you must implement the POST action by using the [HttpPost] attribute. When you pass the item (in this example, a pizza) into the method as a parameter, ASP.NET Core automatically converts any application/JSON sent to the endpoint into a populated .NET Pizza object.

Here’s the method signature of the Create method that you’ll implement in the next section:

C#Copy

[HttpPost]
public IActionResult Create(Pizza pizza)
{            
    // This code will save the pizza and return a result
}

The [HttpPost] attribute maps HTTP POST requests sent to http://localhost:5000/pizza by using the Create() method. Instead of returning a list of pizzas, as we saw with the Get() method, this method returns an IActionResult response.

IActionResult lets the client know if the request succeeded and provides the ID of the newly created pizza. IActionResult uses standard HTTP status codes, so it can easily integrate with clients regardless of the language or platform they’re running on.

ASP.NET Core
action result
HTTP status codeDescription
CreatedAtAction201The pizza was added to the in-memory cache.
The pizza is included in the response body in the media type, as defined in the accept HTTP request header (JSON by default).
BadRequest is implied400The request body’s pizza object is invalid.

Fortunately, ControllerBase has utility methods that create the appropriate HTTP response codes and messages for you. You’ll see how those methods work in the next exercise.

PUT

Modifying or updating a pizza in our inventory is similar to the POST method that you implemented, but it uses the [HttpPut] attribute and takes in the id parameter in addition to the Pizza object that needs to be updated:

C#Copy

[HttpPut("{id}")]
public IActionResult Update(int id, Pizza pizza)
{
    // This code will update the pizza and return a result
}

Each ActionResult instance used in the preceding action is mapped to the corresponding HTTP status code in the following table:

ASP.NET Core
action result
HTTP status codeDescription
NoContent204The pizza was updated in the in-memory cache.
BadRequest400The request body’s Id value doesn’t match the route’s id value.
BadRequest is implied400The request body’s Pizza object is invalid.

DELETE

One of the easier actions to implement is the DELETE action, which takes in just the id parameter of the pizza to remove from the in-memory cache:

C#Copy

[HttpDelete("{id}")]
public IActionResult Delete(int id)
{
    // This code will delete the pizza and return a result
}

Each ActionResult instance used in the preceding action is mapped to the corresponding HTTP status code in the following table:

ASP.NET Core
action result
HTTP status codeDescription
NoContent204The pizza was deleted from the in-memory cache.
NotFound404A pizza that matches the provided id parameter doesn’t exist in the in-memory cache.

lpi linux administration certification training courses malaysia

ASP.NET Core Web API Controllers

In the previous exercise, you created a web application that provides sample weather forecast data, then interacted with it in the HTTP Read-Eval-Print Loop (REPL).

Before you dive in to writing your own PizzaController class, let’s look at the code in the WeatherController sample to understand how it works. In this unit, you learn how WeatherController uses the ControllerBase base class and a few .NET attributes to build a functional web API in a few dozen lines of code. After you understand those concepts, you’re ready to write your own PizzaController class.

Here’s the code for the entire WeatherController class. Don’t worry if it doesn’t make sense yet. Let’s go through it step by step.

C#Copy

using Microsoft.AspNetCore.Mvc;

namespace ContosoPizza.Controllers;

[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
    private static readonly string[] Summaries = new[]
    {
        "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
    };

    private readonly ILogger<WeatherForecastController> _logger;

    public WeatherForecastController(ILogger<WeatherForecastController> logger)
    {
        _logger = logger;
    }

    [HttpGet(Name = "GetWeatherForecast")]
    public IEnumerable<WeatherForecast> Get()
    {
        return Enumerable.Range(1, 5).Select(index => new WeatherForecast
        {
            Date = DateTime.Now.AddDays(index),
            TemperatureC = Random.Shared.Next(-20, 55),
            Summary = Summaries[Random.Shared.Next(Summaries.Length)]
        })
        .ToArray();
    }
}

nodejs training courses malaysia

Create a web API with ASP.NET Core controllers

Create a RESTful service with ASP.NET Core controllers that supports create, read, update, and delete (CRUD) operations.

Learning objectives

In this module, you’ll:

  • Create a web API project with ASP.NET Core controllers.
  • Create an in-memory database for persisting products.
  • Add support for CRUD operations.
  • Test web API action methods from the command shell

vsphere certification training courses malaysia

ASP.NET Core Web API Controllers

In the previous exercise, you created a web application that provides sample weather forecast data, then interacted with it in the HTTP Read-Eval-Print Loop (REPL).

Before you dive in to writing your own PizzaController class, let’s look at the code in the WeatherController sample to understand how it works. In this unit, you learn how WeatherController uses the ControllerBase base class and a few .NET attributes to build a functional web API in a few dozen lines of code. After you understand those concepts, you’re ready to write your own PizzaController class.

Here’s the code for the entire WeatherController class. Don’t worry if it doesn’t make sense yet. Let’s go through it step by step.

C#Copy

using Microsoft.AspNetCore.Mvc;

namespace ContosoPizza.Controllers;

[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
    private static readonly string[] Summaries = new[]
    {
        "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
    };

    private readonly ILogger<WeatherForecastController> _logger;

    public WeatherForecastController(ILogger<WeatherForecastController> logger)
    {
        _logger = logger;
    }

    [HttpGet(Name = "GetWeatherForecast")]
    public IEnumerable<WeatherForecast> Get()
    {
        return Enumerable.Range(1, 5).Select(index => new WeatherForecast
        {
            Date = DateTime.Now.AddDays(index),
            TemperatureC = Random.Shared.Next(-20, 55),
            Summary = Summaries[Random.Shared.Next(Summaries.Length)]
        })
        .ToArray();
    }
}

nodejs training courses malaysia

REST in ASP.NET Core

When you browse to a webpage, the web server communicates with your browser by using HTML, CSS, and JavaScript. For example, If you interact with the page by submitting a sign-in form or selecting a buy button, the browser sends the information back to the web server.

In a similar way, web servers can communicate with a broad range of clients (browsers, mobile devices, other web servers, and more) by using web services. API clients communicate with the server over HTTP, and the two exchange information by using a data format such as JSON or XML. APIs are often used in single-page applications (SPAs) that perform most of the user-interface logic in a web browser. Communication with the web server primarily happens through web APIs.

REST: A common pattern for building APIs with HTTP

Representational State Transfer (REST) is an architectural style for building web services. REST requests are made over HTTP. They use the same HTTP verbs that web browsers use to retrieve webpages and send data to servers. The verbs are:

  • GET: Retrieve data from the web service.
  • POST: Create a new item of data on the web service.
  • PUT: Update an item of data on the web service.
  • PATCH: Update an item of data on the web service by describing a set of instructions about how the item should be modified. The sample application in this module doesn’t use this verb.
  • DELETE: Delete an item of data on the web service.

Web service APIs that adhere to REST are called RESTful APIs. They’re defined through:

  • A base URI.
  • HTTP methods, such as GETPOSTPUTPATCH, or DELETE.
  • A media type for the data, such as JavaScript Object Notation (JSON) or XML.

An API often needs to provide services for a few different but related things. For example, our pizza API might manage pizzas, customers, and orders. We use routing to map URIs (uniform resource identifiers) to logical divisions in our code, so that requests to https://localhost:5000/pizza are routed to PizzaController and requests to https://localhost:5000/order are routed to OrderController.

vmware vsphere certification training courses malaysia

blog1

WEBSITE DESIGN

The significance of virtual world has grown by manifolds. Earlier, the companies needed to engage only in the offline method of marketing, however as the technological advancement happened, there grew need of having a Website for the company and the business houses. There are numerous Web Designing Companies in the market, however, when it comes to strictly individualized approach and reliability in terms of work done, you wouldn’t be able to find a better company than Ultronit Solutions Malaysia. Our highly experienced professionals and team members have completed numerous Web Designing projects in the past with utmost client satisfaction and efficiency. We design responsive User Interface, Themes, Plug-ins, Information Architecture, Front-end, Back-end to create the best Website with the resources available with us. We not only create the website but aim at building the long-lasting relationship with you.

Our Services

Our Web design services

Web layout designing

An immaculate design coupled with equally efficient design could lead to unparalleled growth for your company’s growth. At Ultronit Solutions Malaysia, we make sure to design awesome layout for your company using our highly advanced knowledge in the field of graphic designing and layout designing. Our expertise has made us the best Web Layout designing company in India.

Responsive Design

Being involved in the field of Web Design for several years now, one thing we could ensure with utmost confidence is the reliability and responsiveness of the Web Design projects that we have made. The architecture that we employ along with the advanced technological equipment used by us help us in making state-of-the-art Websites for our clients.

Logo designing

Whenever we think about a company, the first thing that comes to our mind is their Logo, it is an undisputed fact that the Logo of a company provides a distinct look and feel to the company. At Ultronit Solutions Malaysia, we create awesome Logo for your company. We are a Logo Designing Company aimed at providing work of high value.

PSD to HTML slicing

Among the numerous services offered by us in the field of Web Designing, one such service is PSD to HTML Slicing service in India at an affordable rate in a timely manner. You only need to provide us with PSD, AI, Sketch and we will be converting it to HTML in a predefined time.

Newsletter design and email template

In the present time, one of the ways to keep your customers engaged with you and to bring a new audience and potential customers, you would like to invest in Newsletter and Email Marketing. At Ultronit Solutions Malaysia, we create superb designs for your Newsletter and Email which are aimed at efficient marketing.

Flash animation

There are numerous tools available in the market which could provide you with significant recognition in the market. Flash Animation is one among them. At Ultronit Solutions Malaysia, we have been involved in providing stunning Flash Animation services in India and Abroad.

blog1

VMWARE VIRTUALIZATION CONSULTING SERVICES SOLUTIONS COMPANY MALAYSIA

virtualization technology as a way to capitalize on server utilization and considerably diminish the number of systems they have to support and manage. With decades of experience in managing, optimizing, securing, and supporting intricate, mission-critical data center environments for top businesses, Katalyst’s server virtualization consultants are inimitably fit to impartially evaluate, design, execute and support the right virtualization solution to meet your IT requirements and business goals. We take a holistic view of a company’s environment and support the complete virtualization technology life cycle right from planning and valuations to design and operation along with constant management, training, and support

Our Services

Custom IT Solutions for Your Successful Business

Data center and cloud infrastructure

At your own pace, virtualize and combine servers; similarly, handle networking, storage, and security. In only a few minutes, enable provisioning, and finish your private cloud by adding automated management.

Cloud Management

Manage virtualized and dynamic hybrid cloud environments with purpose-built tools. Unify, automate and simplify all facets of management for the highest performance, capacity utilization and compliance.

Desktop and application virtualization

Deliver Windows desktops, apps, and online services to end users in a straightforward and secure manner via virtual datacenters, virtual machines, and physical devices.