public async Task <GetPokemonDto> GetPokemon(EnumPokemonSelectOptions selectOption, string pokemonIdentity)
        {
            var request = new GetItemRequest
            {
                TableName = _tableName,
                Key       = new Dictionary <string, AttributeValue> {
                    { selectOption.ToString(), new AttributeValue {
                          N = pokemonIdentity.ToString()
                      } }
                }
            };

            var response = await _amazonDynamoDb.GetItemAsync(request);

            if (!response.IsItemSet)
            {
                return(new GetPokemonDto());
            }

            var pokemonDto = new GetPokemonDto()
            {
                Number = Convert.ToInt16(response.Item["Number"].N),
                Name   = response.Item["Name"].S,
                Order  = Convert.ToInt16(response.Item["Order"].N),
                Height = Convert.ToInt16(response.Item["Height"].N),
                Weight = Convert.ToInt16(response.Item["Weight"].N),
            };

            return(pokemonDto);
        }
Beispiel #2
0
        internal async Task <Document> GetItemHelperAsync(Key key, GetItemOperationConfig config, CancellationToken cancellationToken)
        {
            var currentConfig = config ?? new GetItemOperationConfig();
            var request       = new GetItemRequest
            {
                TableName      = TableName,
                Key            = key,
                ConsistentRead = currentConfig.ConsistentRead
            };

            this.AddRequestHandler(request, isAsync: true);

            if (currentConfig.AttributesToGet != null)
            {
                request.AttributesToGet = currentConfig.AttributesToGet;
            }

            var result = await DDBClient.GetItemAsync(request, cancellationToken).ConfigureAwait(false);

            var attributeMap = result.Item;

            if (attributeMap == null || attributeMap.Count == 0)
            {
                return(null);
            }
            return(this.FromAttributeMap(attributeMap));
        }
        public async Task <T> Get <T>(object partitionKey, object sortKey = null) where T : Base, new()
        {
            var generic = new T();
            var expressionAttributeNames = generic.GetExpressionAttributes();
            var key = generic.GetKey(partitionKey, sortKey);

            if (partitionKey == null)
            {
                throw new RepositoryException("No partitionKey provided");
            }

            var request = new GetItemRequest
            {
                TableName                = generic.GetTableName(),
                Key                      = key,
                ProjectionExpression     = string.Join(", ", expressionAttributeNames.Keys),
                ExpressionAttributeNames = expressionAttributeNames
            };

            var response = (await amazonDynamoDB.GetItemAsync(request)).Item;

            if (response.Count == 0)
            {
                return(null);
            }

            return(response.Map <T>());
        }
        public async Task <DateTime?> GetLastCheckpoint(string checkpointIdentifier)
        {
            var request = new GetItemRequest()
            {
                TableName = _tableName,
                Key       = new Dictionary <string, AttributeValue>()
                {
                    {
                        DeliveryStreamNameAttribute,
                        new AttributeValue()
                        {
                            S = checkpointIdentifier
                        }
                    }
                },
                ConsistentRead       = true,
                ProjectionExpression = LastCheckpointTimestampAttribute
            };

            var response = await _dynamoDBClient.GetItemAsync(request);

            if (response.Item.Count > 0 &&
                DateTime.TryParse(response.Item[LastCheckpointTimestampAttribute].S, out var checkpoint))
            {
                return(checkpoint.ToUniversalTime());
            }
            else
            {
                return(null);
            }
        }
Beispiel #5
0
        internal Document GetItemHelper(Key key, GetItemOperationConfig config, bool isAsync)
        {
            var currentConfig = config ?? new GetItemOperationConfig();
            var request       = new GetItemRequest
            {
                TableName      = TableName,
                Key            = key,
                ConsistentRead = currentConfig.ConsistentRead
            };

            ((Amazon.Runtime.Internal.IAmazonWebServiceRequest)request).AddBeforeRequestHandler(isAsync ?
                                                                                                new RequestEventHandler(UserAgentRequestEventHandlerAsync) :
                                                                                                new RequestEventHandler(UserAgentRequestEventHandlerSync)
                                                                                                );
            if (currentConfig.AttributesToGet != null)
            {
                request.AttributesToGet = currentConfig.AttributesToGet;
            }

            var result       = DDBClient.GetItem(request);
            var attributeMap = result.Item;

            if (attributeMap == null || attributeMap.Count == 0)
            {
                return(null);
            }
            return(Document.FromAttributeMap(attributeMap));
        }
Beispiel #6
0
        public void GetDataDynamoDbEmployee()
        {
            GetItemRequest request = new GetItemRequest
            {
                TableName = tableName,
                Key       = new Dictionary <string, AttributeValue>
                {
                    { "Id", new AttributeValue {
                          N = "3"
                      } },
                    { "EmployeeName", new AttributeValue {
                          S = "Mehmet Karagöz"
                      } }
                }
            };

            var response = client.GetItem(request);

            if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
            {
                if (response.Item.Count > 0)
                {
                    foreach (var emp in response.Item)
                    {
                        Console.WriteLine($"Key =>{emp.Key}, Value =>{emp.Value.S} {emp.Value.N}");
                    }
                }
                else
                {
                    Console.WriteLine("Item Not Found");
                }
            }
            Console.ReadLine();
        }
            static async Task <DynamoDbScore> GetAsync(
                IAmazonDynamoDB client,
                string tableName,
                Guid ownerId,
                Guid scoreId)
            {
                var partitionKey = ScoreDatabaseUtils.ConvertToPartitionKey(ownerId);
                var score        = ScoreDatabaseUtils.ConvertToBase64(scoreId);

                var request = new GetItemRequest()
                {
                    TableName = tableName,
                    Key       = new Dictionary <string, AttributeValue>()
                    {
                        [DynamoDbScorePropertyNames.PartitionKey] = new AttributeValue(partitionKey),
                        [DynamoDbScorePropertyNames.SortKey]      =
                            new AttributeValue(ScoreDatabaseConstant.ScoreIdMainPrefix + score),
                    },
                };
                var response = await client.GetItemAsync(request);

                if (!response.IsItemSet)
                {
                    throw new NotFoundScoreException("Not found score.");
                }

                var dynamoDbScore = new DynamoDbScore(response.Item);

                return(dynamoDbScore);
            }
Beispiel #8
0
        public async Task <IConversationContext> FetchContextAsync(IConversationContext context)
        {
            var request = new GetItemRequest
            {
                TableName = this.config.BotConversationContextTableName,
                Key       = new Dictionary <string, AttributeValue>()
                {
                    { "Id", new AttributeValue {
                          SS = new List <string> {
                              context.ConnectorType.ToString(), context.Entry.Message.Sender.Id
                          }
                      } }
                }
            };

            var response = await client.GetItemAsync(request);

            AttributeValue contextData = null;

            if (response.IsItemSet && response.Item.TryGetValue("ContextData", out contextData))
            {
                var data = this.serializer.Deserialize <AwsConversationContext>(contextData.S);
                context.Route = data.Route;
                context.Reply = data.Reply;
            }

            return(context);
        }
Beispiel #9
0
        /// Accessor for a specific entry in the database
        /// @param primaryKey the key used to lookup the entry in the database
        protected async Task <DatabaseItem> GetEntryByKey(int primaryKey)
        {
            var getRequest = new GetItemRequest
            {
                TableName = tableName,
                Key       = new Dictionary <string, AttributeValue>
                {
                    { primaryPartitionKey, new AttributeValue {
                          N = primaryKey.ToString()
                      } }
                }
            };

            DatabaseItem item = new DatabaseItem();

            try
            {
                var response = await client.GetItemAsync(getRequest);

                if (response.IsItemSet)
                {
                    item = response.Item;
                }
            }
            catch (Exception e)
            {
                log.WARN("DatabaseClient", "GetEntryByKey(int)", "EXCEPTION: " + e.Message);
            }

            return(item);
        }
Beispiel #10
0
        public static async Task GetItemAsync()
        {
            #region service_client_get
            using (var ddbClient = new AmazonDynamoDBClient())
            {
                var request = new GetItemRequest
                {
                    TableName = "TODOList",
                    Key       = new Dictionary <string, AttributeValue>
                    {
                        { "User", new AttributeValue {
                              S = "serviceclient-testuser"
                          } },
                        { "ListId", new AttributeValue {
                              S = "generated-list-id"
                          } }
                    }
                };

                var response = await ddbClient.GetItemAsync(request);

                if (response.Item.Count > 0)
                {
                    Dictionary <string, AttributeValue> item = response.Item;
                    Console.WriteLine($"List Name {response.Item["Name"].S}");
                    PrintItem(item);
                }
                else
                {
                    Console.WriteLine("TODO List item not found");
                }
            }
            #endregion
        }
Beispiel #11
0
        public void Get_item_with_AWSSDK()
        {
            db.PutItem(new Todo {
                Id = 1, Content = "TODO 1", Order = 1
            });

            var request = new GetItemRequest
            {
                TableName = "Todo",
                Key       = new Dictionary <string, AttributeValue> {
                    { "Id", new AttributeValue {
                          N = "1"
                      } }
                },
                ConsistentRead = true,
            };

            var response = awsDb.GetItem(request);
            var todo     = new Todo
            {
                Id      = Convert.ToInt64(response.Item["Id"].N),
                Content = response.Item["Content"].S,
                Order   = Convert.ToInt32(response.Item["Order"].N),
                Done    = response.Item["Done"].BOOL,
            };

            todo.PrintDump();
        }
Beispiel #12
0
        /// <summary>
        /// Retrieves an item from the public catalog.
        /// </summary>
        public static async Task <PlayFabResult <GetItemResponse> > GetItemAsync(GetItemRequest request, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            await new PlayFabUtil.SynchronizationContextRemover();

            var requestContext  = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
            var requestSettings = PlayFabSettings.staticSettings;

            if (requestContext.EntityToken == null)
            {
                throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
            }


            var httpResult = await PlayFabHttp.DoPost("/Catalog/GetItem", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);

            if (httpResult is PlayFabError)
            {
                var error = (PlayFabError)httpResult;
                PlayFabSettings.GlobalErrorHandler?.Invoke(error);
                return(new PlayFabResult <GetItemResponse> {
                    Error = error, CustomData = customData
                });
            }

            var resultRawJson = (string)httpResult;
            var resultData    = PluginManager.GetPlugin <ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject <PlayFabJsonSuccess <GetItemResponse> >(resultRawJson);
            var result        = resultData.data;

            return(new PlayFabResult <GetItemResponse> {
                Result = result, CustomData = customData
            });
        }
        public static async Task ServiceClientExampleAsync()
        {
            try
            {
                var client = new AmazonDynamoDBClient(RegionEndpoint.USWest2);

                var request = new GetItemRequest
                {
                    TableName = "RetailDatabase",
                    Key       = new Dictionary <string, AttributeValue>
                    {
                        { "pk", new AttributeValue {
                              S = "*****@*****.**"
                          } },
                        { "sk", new AttributeValue {
                              S = "metadata"
                          } }
                    }
                };

                var response = await client.GetItemAsync(request);

                Console.WriteLine($"Item retrieved with {response.Item.Count} attributes.");
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
            }
        }
Beispiel #14
0
        protected override void getItem()
        {
            var request = new GetItemRequest
            {
                TableName = tableName,
                Key       = new Key
                {
                    HashKeyElement = new AttributeValue {
                        N = bufferID.ToString()
                    },
                    RangeKeyElement = new AttributeValue {
                        N = serieID.ToString()
                    }
                },
                // Optional parameters.
                AttributesToGet = new List <string>()
                {
                    "FirstDataItemID", "LastDataItemID", "SerieID", "BufferID", "StartTime"
                },
                ConsistentRead = true
            };
            var response = client.GetItem(request);
            // Check the response.
            var result = response.GetItemResult;
            Dictionary <String, AttributeValue> attributeMap = result.Item;

            firstDataItemID = int.Parse(attributeMap["FirstDataItemID"].N);
            lastDataItemID  = int.Parse(attributeMap["LastDataItemID"].N);
            serieID         = int.Parse(attributeMap["SerieID"].N);
            bufferID        = int.Parse(attributeMap["BufferID"].N);
            startTime       = attributeMap["StartTime"].S;
        }
Beispiel #15
0
        public Contract Get(string contractId)
        {
            SetupDatabase();

            var request = new GetItemRequest()
            {
                TableName = ContractTableName,
                Key       = new Dictionary <string, AttributeValue>()
                {
                    { "ContractId", new AttributeValue()
                      {
                          S = contractId
                      } }
                }
            };

            var result = DbClient.GetItemAsync(request);

            result.Wait();

            if (result.IsCompletedSuccessfully)
            {
                var contract      = GetContract(result.Result.Item);
                var assetProvider = new AssetProvider(DbClient);
                contract.Assets = assetProvider.GetAssets(contract.ContractId);
                return(contract);
            }

            throw new ApplicationException("Error reading Contract information", result.Exception);
        }
        internal GetItemResponse GetItem(GetItemRequest request)
        {
            var marshaller   = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.Instance;

            return(Invoke <GetItemRequest, GetItemResponse>(request, marshaller, unmarshaller));
        }
Beispiel #17
0
        private IList <ErrorStatus> Validate(GetItemRequest request)
        {
            var errors = new List <ErrorStatus>();


            if (string.IsNullOrEmpty(request.Ticket))
            {
                errors.Add(new ErrorStatus("INVALID_TICKET"));
                return(errors);
            }

            if (request.ItemId == null || request.ItemId <= 0)
            {
                errors.Add(new ErrorStatus("BAD_REQUEST"));
                return(errors);
            }

            var user = _userSessionRepository.GetUserBySessionId(request.Ticket);

            var userOwner = _itemRepository.GetUserByItemId(request.ItemId);

            if (user == null || userOwner == null)
            {
                errors.Add(new ErrorStatus("USER_NOT_FOUND"));
                return(errors);
            }

            if (user.Id != userOwner.Id)
            {
                errors.Add(new ErrorStatus("UNAUTHORIZED_ACESS"));
            }

            return(errors);
        }
        public async Task <Habit> GetItem(string teamId, string habitId)
        {
            var request = new GetItemRequest()
            {
                TableName = Constants.HabitTableName,
                Key       = new Dictionary <string, AttributeValue>()
                {
                    { "TeamId", new AttributeValue()
                      {
                          S = teamId
                      } },
                    { "HabitId", new AttributeValue()
                      {
                          S = habitId
                      } }
                }
            };

            var result = await _dbClient.GetItemAsync(request);

            if (result.Item != null)
            {
                return(GetItem(result.Item));
            }
            else
            {
                return(null);
            }
        }
Beispiel #19
0
        public async Task <Project> GetProjectByIdForUserAsync(string username, string projectId)
        {
            // Query for all Project records owned by this user.
            var getRequest = new GetItemRequest
            {
                TableName = this.projectsTableName,
                Key       = new Dictionary <string, AttributeValue>
                {
                    { "Id", new AttributeValue {
                          S = projectId
                      } },
                    { "OwningUser", new AttributeValue {
                          S = username
                      } },
                }
            };

            GetItemResponse results = await this.dynamoDB.GetItemAsync(getRequest);

            // Convert the NoSql document into a domain model.
            Dictionary <string, AttributeValue> document = results.Item;
            Guid id      = Guid.Parse(document["Id"].S);
            var  project = new Project(id, document["OwningUser"].S, document["Priority"].S, document["Status"].S, document["Title"].S, document["Type"].S);

            return(project);
        }
        public async Task <string> GetItems <T>(T tabelaInterna, string nomeTabela)
        {
            try
            {
                //Identificar tabela
                table = Table.LoadTable(_dynamoClient, nomeTabela);
                //Criar contexto
                DynamoDBContext db = new DynamoDBContext(_dynamoClient);
                //Identificando campos do objeto genérico preenchidos
                Document documentRequest = db.ToDocument(tabelaInterna);
                //Mapeando os campos
                chave = table.ToAttributeMap(documentRequest);
                //Verificar quais campos são necessarios
                chave = Utils.VerificarChaves(chave, table);
                //Criar objeto para requisição na AWS
                var itemRequest = new GetItemRequest(nomeTabela, chave);
                //Realizar o GET
                var response = await _dynamoClient.GetItemAsync(itemRequest, cancellationToken);

                //Receber itens do response
                var responseItems = response.Item;
                //Mapear os campos de retorno
                var document2 = table.FromAttributeMap(response.Item);
                //Garantir o dispose da conexão
                db.Dispose();
                //Converter para Json
                return(document2.ToJson());
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #21
0
        public static async Task AssertItemAsync(
            this IAmazonDynamoDB db,
            string tableName,
            Dictionary <string, AttributeValue> key,
            Dictionary <string, AttributeValue> expectedItem
            )
        {
            GetItemRequest request = new GetItemRequest {
                TableName      = tableName,
                Key            = key,
                ConsistentRead = true
            };

            GetItemResponse response = await db
                                       .GetItemAsync(request)
                                       .ConfigureAwait(false);

            if (!response.IsItemSet)
            {
                Assert.Fail("Item should exist.");
            }

            AttributeValueAssert.AreEqual(
                actual: response.Item,
                expected: expectedItem
                );
        }
Beispiel #22
0
        protected override void getItem()
        {
            var request = new GetItemRequest
            {
                TableName = tableName,
                Key       = new Key
                {
                    RangeKeyElement = new AttributeValue {
                        N = ID.ToString()
                    },
                    HashKeyElement = new AttributeValue {
                        S = dataOwnerID
                    }
                },
                // Optional parameters.
                AttributesToGet = new List <string>()
                {
                    "ID", "NextID", "PrevID", "BufferID", "Name"
                },
                ConsistentRead = true
            };
            var response = client.GetItem(request);
            // Check the response.
            var result = response.GetItemResult;
            Dictionary <String, AttributeValue> attributeMap = result.Item;

            ID       = int.Parse(attributeMap["ID"].N);
            name     = attributeMap["Name"].S;
            nextID   = int.Parse(attributeMap["NextID"].N);
            prevID   = int.Parse(attributeMap["PrevID"].N);
            bufferID = int.Parse(attributeMap["BufferID"].N);
        }
        private static void RetrieveItem(string partitionKey, string sortKey)
        {
            var request = new GetItemRequest
            {
                TableName = tableName,
                Key       = new Dictionary <string, AttributeValue>()
                {
                    { "Id", new AttributeValue {
                          S = partitionKey
                      } },
                    { "ReplyDateTime", new AttributeValue {
                          S = sortKey
                      } }
                },
                ConsistentRead = true
            };
            var response = client.GetItem(request);

            // Check the response.
            var attributeList = response.Item; // attribute list in the response.

            Console.WriteLine("\nPrinting item after retrieving it ............");

            PrintItem(attributeList);
        }
Beispiel #24
0
        private string GetFact(int factId)
        {
            var request = new GetItemRequest {
                TableName = _tableName,
                Key       = new Dictionary <string, AttributeValue>()
                {
                    {
                        "Id", new AttributeValue()
                        {
                            N = factId.ToString()
                        }
                    }
                }
            };
            var task = _dynamoClient.GetItemAsync(request);

            task.Wait();
            AttributeValue fact;

            if (task.Result.Item.TryGetValue("Fact", out fact))
            {
                LambdaLogger.Log($"INFO: Fact returned from database was #{factId}: {fact.S}");
                return(fact.S);
            }
            else
            {
                // GetFact();
                return("Sorry, could not retrieve a fact");
            }
        }
Beispiel #25
0
        internal Document GetItemHelper(Key key, GetItemOperationConfig config)
        {
            var currentConfig = config ?? new GetItemOperationConfig();
            var request       = new GetItemRequest
            {
                TableName      = TableName,
                Key            = key,
                ConsistentRead = currentConfig.ConsistentRead
            };

            this.AddRequestHandler(request, isAsync: false);

            if (currentConfig.AttributesToGet != null)
            {
                request.AttributesToGet = currentConfig.AttributesToGet;
            }

            var result       = DDBClient.GetItem(request);
            var attributeMap = result.Item;

            if (attributeMap == null || attributeMap.Count == 0)
            {
                return(null);
            }
            return(this.FromAttributeMap(attributeMap));
        }
Beispiel #26
0
        protected override void getItem()
        {
            var request = new GetItemRequest
            {
                TableName = tableName,
                Key       = new Key
                {
                    HashKeyElement = new AttributeValue {
                        S = dataOwnerID.ToString()
                    }
                },
                // Optional parameters.
                AttributesToGet = new List <string>()
                {
                    "DataOwnerID", "FirstDeviceID", "LastDeviceID"
                },
                ConsistentRead = true
            };
            var response = client.GetItem(request);
            // Check the response.
            var result = response.GetItemResult;
            Dictionary <String, AttributeValue> attributeMap = result.Item;

            firstDeviceID = int.Parse(attributeMap["FirstDeviceID"].N);
            lastDeviceID  = int.Parse(attributeMap["LastDeviceID"].N);
            dataOwnerID   = attributeMap["DataOwnerID"].S;
        }
            static async Task <(DynamoDbScoreDataV1 data, string hash)> GetAsync(
                IAmazonDynamoDB client,
                string tableName,
                Guid ownerId,
                Guid scoreId)
            {
                var partitionKey = ScoreDatabaseUtils.ConvertToPartitionKey(ownerId);
                var score        = ScoreDatabaseUtils.ConvertToBase64(scoreId);

                var request = new GetItemRequest()
                {
                    TableName = tableName,
                    Key       = new Dictionary <string, AttributeValue>()
                    {
                        [DynamoDbScorePropertyNames.PartitionKey] = new AttributeValue(partitionKey),
                        [DynamoDbScorePropertyNames.SortKey]      =
                            new AttributeValue(ScoreDatabaseConstant.ScoreIdMainPrefix + score),
                    },
                };
                var response = await client.GetItemAsync(request);

                var data = response.Item[DynamoDbScorePropertyNames.Data];

                if (data is null)
                {
                    throw new InvalidOperationException("not found.");
                }


                DynamoDbScoreDataV1.TryMapFromAttributeValue(data, out var result);
                var hash = response.Item[DynamoDbScorePropertyNames.DataHash].S;

                return(result, hash);
            }
Beispiel #28
0
        private T ConvertGetItemResponse <T>(GetItemRequest request, DynamoMetadataType table)
        {
            var response = Exec(() => DynamoDb.GetItem(request), rethrowExceptions: throwNotFoundExceptions);

            if (!response.IsItemSet)
            {
                return(default);
Beispiel #29
0
        /// <summary>
        /// Read an entry from a DynamoDB table
        /// </summary>
        /// <typeparam name="TResult">The result type</typeparam>
        /// <param name="tableName">The name of the table to search for the entry</param>
        /// <param name="keys">The table entry keys to search for</param>
        /// <param name="resolver">Function that will be called to translate the returned fields into a concrete type. This Function is only called if the result is != null</param>
        /// <returns>The object translated by the resolver function</returns>
        public async Task <TResult> ReadSingleEntryAsync <TResult>(string tableName, Dictionary <string, AttributeValue> keys, Func <Dictionary <string, AttributeValue>, TResult> resolver) where TResult : class
        {
            try
            {
                var request = new GetItemRequest
                {
                    TableName      = tableName,
                    Key            = keys,
                    ConsistentRead = true
                };

                var response = await ddbClient.GetItemAsync(request);

                if (response.IsItemSet)
                {
                    return(resolver(response.Item));
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                if (Logger.IsEnabled(LogLevel.Debug))
                {
                    Logger.Debug("Unable to find table entry for Keys = {0}", Utils.DictionaryToString(keys));
                }
                throw;
            }
        }
        private async void GetItem()
        {
            AmazonDynamoDBClient client = new AmazonDynamoDBClient(awsCredentials, awsRegion);

            Dictionary <string, AttributeValue> key = new Dictionary <string, AttributeValue>
            {
                { "Id", new AttributeValue {
                      N = "10"
                  } }
            };

            GetItemRequest request = new GetItemRequest
            {
                TableName = "Books",
                Key       = key,
            };

            var result = await client.GetItemAsync(request);

            Console.WriteLine("Item:");
            Dictionary <string, AttributeValue> item = result.Item;

            foreach (var keyValuePair in item)
            {
                Console.WriteLine("Author := {0}", item["Author"]);
                Console.WriteLine("Title := {0}", item["Title"]);
                Console.WriteLine("Price:= {0}", item["Price"]);
                Console.WriteLine("PageCount := {0}", item["PageCount"]);
            }
        }