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

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