24 lines
559 B
C#
24 lines
559 B
C#
using System.ComponentModel.DataAnnotations;
|
|
// Data annotations: https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations?view=net-9.0
|
|
|
|
namespace ServerManagement.Models
|
|
{
|
|
public class Server
|
|
{
|
|
public Server()
|
|
{
|
|
Random random = new Random();
|
|
int randomNumber = random.Next(0, 2);
|
|
IsOnline = randomNumber != 0;
|
|
}
|
|
|
|
public int Id { get; set; }
|
|
public bool IsOnline { get; set; }
|
|
|
|
[Required]
|
|
public string? Name { get; set; }
|
|
|
|
[Required]
|
|
public string? City { get; set; }
|
|
}
|
|
} |