mirror of
https://github.com/PacktPublishing/Web-Development-with-Blazor-Second-Edition.git
synced 2026-04-07 23:33:53 +00:00
Initial commit
This commit is contained in:
parent
2190113c56
commit
3088165398
1765 changed files with 192085 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using BlazorServer.Data;
|
||||
|
||||
namespace BlazorServer.Pages
|
||||
{
|
||||
//<FetchDataWithCodeBehind>
|
||||
public partial class FetchDataWithCodeBehind
|
||||
{
|
||||
[Inject]
|
||||
public WeatherForecastService ForecastService { get; set; }
|
||||
private WeatherForecast[] forecasts;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
forecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now));
|
||||
}
|
||||
}
|
||||
//</FetchDataWithCodeBehind>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue