diff --git a/src/MultiShop/Client/Pages/Counter.razor b/src/MultiShop/Client/Pages/Counter.razor deleted file mode 100644 index bd823e5..0000000 --- a/src/MultiShop/Client/Pages/Counter.razor +++ /dev/null @@ -1,16 +0,0 @@ -@page "/counter" - -

Counter

- -

Current count: @currentCount

- - - -@code { - private int currentCount = 0; - - private void IncrementCount() - { - currentCount++; - } -} diff --git a/src/MultiShop/Client/Pages/FetchData.razor b/src/MultiShop/Client/Pages/FetchData.razor deleted file mode 100644 index 91a9935..0000000 --- a/src/MultiShop/Client/Pages/FetchData.razor +++ /dev/null @@ -1,56 +0,0 @@ -@page "/fetchdata" -@using Microsoft.AspNetCore.Authorization -@using Microsoft.AspNetCore.Components.WebAssembly.Authentication -@using MultiShop.Shared -@attribute [Authorize] -@inject HttpClient Http - -

Weather forecast

- -

This component demonstrates fetching data from the server.

- -@if (forecasts == null) -{ -

Loading...

-} -else -{ - - - - - - - - - - - @foreach (var forecast in forecasts) - { - - - - - - - } - -
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
-} - -@code { - private WeatherForecast[] forecasts; - - protected override async Task OnInitializedAsync() - { - try - { - forecasts = await Http.GetFromJsonAsync("WeatherForecast"); - } - catch (AccessTokenNotAvailableException exception) - { - exception.Redirect(); - } - } - -} diff --git a/src/MultiShop/Server/Controllers/WeatherForecastController.cs b/src/MultiShop/Server/Controllers/WeatherForecastController.cs deleted file mode 100644 index 50f4aff..0000000 --- a/src/MultiShop/Server/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using MultiShop.Shared; - -namespace MultiShop.Server.Controllers -{ - [Authorize] - [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 _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet] - public IEnumerable Get() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } - } -} diff --git a/src/MultiShop/Shared/WeatherForecast.cs b/src/MultiShop/Shared/WeatherForecast.cs deleted file mode 100644 index a531ade..0000000 --- a/src/MultiShop/Shared/WeatherForecast.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace MultiShop.Shared -{ - public class WeatherForecast - { - public DateTime Date { get; set; } - - public int TemperatureC { get; set; } - - public string Summary { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - } -}