You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
550 B

2 years ago
using System.ComponentModel.DataAnnotations;
2 years ago
namespace BlazorServerApp.Data
{
public class WeatherForecast
{
public DateTime Date { get; set; }
2 years ago
[Required(ErrorMessage = "Need TemperatureC")]
[Range(typeof(int), "-100", "100")]
2 years ago
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
2 years ago
[Required(ErrorMessage = "Need Summary")]
[StringLength(10, MinimumLength = 2, ErrorMessage = "2~10")]
2 years ago
public string? Summary { get; set; }
}
}