using System.Collections.Generic;
public int RoomId { get; set; }
public string RoomNumber { get; set; }
public string Type { get; set; }
public int Capacity { get; set; }
public bool IsTaken { get; set; } = false;
static string Sencilla { get; } = nameof(Sencilla);
static string Doble { get; } = nameof(Doble);
static string Familiar { get; } = nameof(Familiar);
public static void Main()
List<Habitacion> seed = new List<Habitacion>();
Random random = new Random();
List<string> tiposDeHabitacion = new List<string> { Sencilla, Doble, Familiar };
HashSet<string> habitacionesGeneradas = new HashSet<string>();
for (int i = 0; i < cantidad; i++)
numeroHabitacion = "H" + random.Next(100, 1000).ToString();
} while (habitacionesGeneradas.Contains(numeroHabitacion));
habitacionesGeneradas.Add(numeroHabitacion);
string tipoHabitacion = tiposDeHabitacion[random.Next(tiposDeHabitacion.Count)];
int capacidad = (tipoHabitacion == Sencilla) ? 1 : (tipoHabitacion == Doble) ? 2 : 4;
RoomNumber = numeroHabitacion,
IsTaken = (DateTime.Now.Ticks %2 == 0)
foreach( var room in seed)
var grouped = seed.GroupBy( x => x.Type).Select( x => new { Type = x.Key, TotalFree = x.Count( x => !x.IsTaken )});
foreach( var room in grouped)
Console.WriteLine( $"Type : { room.Type} | Free : {room.TotalFree}" );
var familar = grouped.First(x => x.Type == "Familiar");
Console.WriteLine(familar.TotalFree);