public Item getById(int itemId) { sql = dataBase.selectAllFrom("Item", new List <string>() { "itemID = ?" }); item = new Item(); command.CommandText = sql; command.Parameters.Add(itemId); try { reader = command.ExecuteReader(); while (reader.Read()) { item = mapper.assignValuesFrom(reader); } } catch (Exception e) { Console.WriteLine(e.GetBaseException()); throw new Exception(e.Message); } finally { dataBase.exitConnection(); } return(item); }