public List <Dormitory> GetDormitories()
        {
            _logger.LogInfo("Getting Dormitories");

            var query       = "SELECT * FROM [Dormitories] ORDER BY [Number]";
            var dormitories = new List <Dormitory>();

            using (var reader = _dbConnection.ExecuteReader(query))
            {
                while (reader.Read())
                {
                    dormitories.Add(new Dormitory()
                    {
                        Id          = Convert.ToInt32(reader["Id"]),
                        Description = reader["Description"].ToString(),
                        Address     = reader["Address"].ToString(),
                        Number      = Convert.ToInt32(reader["Number"]),
                        Comendant   = _administratorService.GetAdministratorById(Convert.ToInt32(reader["ComendantId"])),
                        Floors      = _floorService.GetFloorsByDormitoryId(Convert.ToInt32(reader["Id"]))
                    });
                }
            }

            return(dormitories);
        }
 public List <Floor> GetFloorByDormitoryId(int dormitoryId)
 {
     _logger.LogInfo("API HttpGet api/floors/dormitory/{dormitoryId}");
     try
     {
         return(_floorService.GetFloorsByDormitoryId(dormitoryId));
     }
     catch (System.Exception e)
     {
         _logger.LogError("API HttpGet api/floors/dormitory/{dormitoryId}  " + e.Message);
         throw e;
     }
 }