Fetching data from an API

We currently have no concept of a "product" on the server side of our application, so let's remedy that by creating a product entity and migration to start off with. Create a Data/Entities/Product.cs class with the following contents:

namespace ECommerce.Data.Entities{  public class Product  {    public int Id { get; set; }    [Required]    public string Name { get; set; }    [Required]    public string Slug { get; set; }    [Required]    public string Thumbnail { get; set; }    [Required]    public string ShortDescription { get; set; }    [Required]    public string Description { get; set; }    [Required]    public decimal Price { get; set; }  }}

The properties of this class match the properties that we've been rendering in our UI so far. We've also added ...

Get ASP.NET Core 2 and Vue.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.