From d2c41943f6528c57a67d0bbeb99fee77c57ad521 Mon Sep 17 00:00:00 2001 From: MarcUs7i <96580944+MarcUs7i@users.noreply.github.com> Date: Mon, 20 Jan 2025 20:55:43 +0100 Subject: [PATCH] Implemented AskForRoom() and NoOfEmployees in Company.cs --- BuildingDirectory/Model/Company.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/BuildingDirectory/Model/Company.cs b/BuildingDirectory/Model/Company.cs index 5537d82..a972954 100644 --- a/BuildingDirectory/Model/Company.cs +++ b/BuildingDirectory/Model/Company.cs @@ -24,12 +24,11 @@ public sealed class Company /// Gets the name of the company /// public string Name { get; } - + /// /// Gets the number of employees working for the company /// - // TODO - public int NoOfEmployees => -1; + public int NoOfEmployees => _employeeRooms.Count; /// /// Returns the room number the clerk identified by the provided @@ -39,8 +38,8 @@ public sealed class Company /// Room number if found; null otherwise public int? AskForRoom(BusinessCard businessCard) { - // TODO - return -1; + bool found = _employeeRooms.TryGetValue(businessCard, out int room); + return found ? room : null; } } \ No newline at end of file