From dae84a9660ed572dc150e548eb71ac38a0efbf6e Mon Sep 17 00:00:00 2001 From: Sjory Date: Thu, 5 Dec 2024 13:23:12 +0100 Subject: Updated to .Net v8.0 since there was almost no development made except a few test. i startet from scratch with .Net 8.0 and made a Blazor (Auot - Server/Web app) --- DrinksMachineWebsite/Pages/Counter.razor | 61 ------------------------------ DrinksMachineWebsite/Pages/Error.cshtml | 42 -------------------- DrinksMachineWebsite/Pages/Error.cshtml.cs | 27 ------------- DrinksMachineWebsite/Pages/FetchData.razor | 47 ----------------------- DrinksMachineWebsite/Pages/Index.razor | 9 ----- DrinksMachineWebsite/Pages/_Host.cshtml | 34 ----------------- 6 files changed, 220 deletions(-) delete mode 100644 DrinksMachineWebsite/Pages/Counter.razor delete mode 100644 DrinksMachineWebsite/Pages/Error.cshtml delete mode 100644 DrinksMachineWebsite/Pages/Error.cshtml.cs delete mode 100644 DrinksMachineWebsite/Pages/FetchData.razor delete mode 100644 DrinksMachineWebsite/Pages/Index.razor delete mode 100644 DrinksMachineWebsite/Pages/_Host.cshtml (limited to 'DrinksMachineWebsite/Pages') diff --git a/DrinksMachineWebsite/Pages/Counter.razor b/DrinksMachineWebsite/Pages/Counter.razor deleted file mode 100644 index ac2f9c7..0000000 --- a/DrinksMachineWebsite/Pages/Counter.razor +++ /dev/null @@ -1,61 +0,0 @@ -@page "/counter" -@using DrinksMachineWebsite.Data - -Drinks - -

List of Drinks

- -@if (drinks[0] == null) -{ -

Loading...

-} -else -{ - - - - - - - - - - - @for (int i = 0; i < 1; i++) - { - - - - - - - - - } - - -
NameDescriptionAlcoholAmount of shots
@drinks[i].Name@drinks[i].Description@drinks[i].AlcoholAndAmounts.Alcohol.name@drinks[i].AlcoholAndAmounts.amountOfShots
-} - - - - - -@code { - private int currentCount = 0; - public static Alcohol gin = new Alcohol("Gin", 40, 70); - private static AlcoholAndAmount ginInGinTnoic = new AlcoholAndAmount(gin, 2); - public Drinks ginTonic = new Drinks("Gin & Tonic", "a nice classic that my dear babesiboo loves", ginInGinTnoic); - - public Drinks[] drinks = new Drinks[100]; - - public void Updatelist(){ - drinks[0] = ginTonic; - } - - - private void IncrementCount() - { - currentCount++; - } -} diff --git a/DrinksMachineWebsite/Pages/Error.cshtml b/DrinksMachineWebsite/Pages/Error.cshtml deleted file mode 100644 index a628403..0000000 --- a/DrinksMachineWebsite/Pages/Error.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@page -@model DrinksMachineWebsite.Pages.ErrorModel - - - - - - - - Error - - - - - -
-
-

Error.

-

An error occurred while processing your request.

- - @if (Model.ShowRequestId) - { -

- Request ID: @Model.RequestId -

- } - -

Development Mode

-

- Swapping to the Development environment displays detailed information about the error that occurred. -

-

- The Development environment shouldn't be enabled for deployed applications. - It can result in displaying sensitive information from exceptions to end users. - For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development - and restarting the app. -

-
-
- - - diff --git a/DrinksMachineWebsite/Pages/Error.cshtml.cs b/DrinksMachineWebsite/Pages/Error.cshtml.cs deleted file mode 100644 index 0c7af17..0000000 --- a/DrinksMachineWebsite/Pages/Error.cshtml.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using System.Diagnostics; - -namespace DrinksMachineWebsite.Pages -{ - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] - [IgnoreAntiforgeryToken] - public class ErrorModel : PageModel - { - public string? RequestId { get; set; } - - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - - private readonly ILogger _logger; - - public ErrorModel(ILogger logger) - { - _logger = logger; - } - - public void OnGet() - { - RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; - } - } -} \ No newline at end of file diff --git a/DrinksMachineWebsite/Pages/FetchData.razor b/DrinksMachineWebsite/Pages/FetchData.razor deleted file mode 100644 index 2aefd4a..0000000 --- a/DrinksMachineWebsite/Pages/FetchData.razor +++ /dev/null @@ -1,47 +0,0 @@ -@page "/fetchdata" -@using DrinksMachineWebsite.Data -@inject WeatherForecastService ForecastService - -Weather forecast - -

Weather forecast

- -

This component demonstrates fetching data from a service.

- -@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() - { - forecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now)); - } -} diff --git a/DrinksMachineWebsite/Pages/Index.razor b/DrinksMachineWebsite/Pages/Index.razor deleted file mode 100644 index 6085c4a..0000000 --- a/DrinksMachineWebsite/Pages/Index.razor +++ /dev/null @@ -1,9 +0,0 @@ -@page "/" - -Index - -

Hello, world!

- -Welcome to your new app. - - diff --git a/DrinksMachineWebsite/Pages/_Host.cshtml b/DrinksMachineWebsite/Pages/_Host.cshtml deleted file mode 100644 index 09cd543..0000000 --- a/DrinksMachineWebsite/Pages/_Host.cshtml +++ /dev/null @@ -1,34 +0,0 @@ -@page "/" -@using Microsoft.AspNetCore.Components.Web -@namespace DrinksMachineWebsite.Pages -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers - - - - - - - - - - - - - - - - -
- - An error has occurred. This application may no longer respond until reloaded. - - - An unhandled exception has occurred. See browser dev tools for details. - - Reload - 🗙 -
- - - - -- cgit v1.3.1