blazor added back

This commit is contained in:
2021-10-13 17:33:18 -04:00
parent bf937f7a2e
commit d0ad783cfd
35 changed files with 1410 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
using System;
namespace Web.Data
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int) (TemperatureC / 0.5556);
public string Summary { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Linq;
using System.Threading.Tasks;
namespace Web.Data
{
public class WeatherForecastService
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate)
{
var rng = new Random();
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
}).ToArray());
}
}
}