• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Model.GetItemRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Amazon.DynamoDBv2.Model.GetItemRequest的典型用法代码示例。如果您正苦于以下问题:C# GetItemRequest类的具体用法?C# GetItemRequest怎么用?C# GetItemRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GetItemRequest类属于Amazon.DynamoDBv2.Model命名空间,在下文中一共展示了GetItemRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetItem

        public int GetItem(string dbKey, string dbKeyValue, string table, out GetItemResponse paramResponse)
        {
            GetItemRequest request = new GetItemRequest();

            request.TableName = table;     // set the table name for DynamoDB
            request.Key = new Dictionary<string, AttributeValue>() { { dbKey, new AttributeValue { S = dbKeyValue } } };

            int response = (int)DBEnum.DBResponseCodes.DEFAULT_VALUE;

            try
            {
                paramResponse = this.client.GetItem(request);  // value set to NOT null

                //Check to see if entry exist
                if (0 == paramResponse.Item.Count) // Entry does not exist
                {
                    response = (int)DBEnum.DBResponseCodes.DOES_NOT_EXIST;
                }

                else // Entry exists
                {
                    response = (int)DBEnum.DBResponseCodes.SUCCESS;
                }

            }

            catch
            {
                response = (int)DBEnum.DBResponseCodes.DYNAMODB_EXCEPTION;  // set reponse to DB Exception flag
                paramResponse = null;       // set to null on Error
            }

            return response;
        }
开发者ID:gem-carry,项目名称:GemCarryServer,代码行数:34,代码来源:DBManager.cs


示例2: GetData1

 // Get TestID
 public static void GetData1(int Id)
 {
     var Req = new Amazon.DynamoDBv2.Model.GetItemRequest
     {
         TableName = "TestID",
         Key = new Dictionary<string, Amazon.DynamoDBv2.Model.AttributeValue>() { {"Id",new Amazon.DynamoDBv2.Model.AttributeValue{N=Id.ToString()}}}
     };
     var Rsp = client.GetItem(Req);
     PrintItem(Rsp.GetItemResult.Item);
     Console.ReadLine();
 }
开发者ID:ChunTaiChen,项目名称:AwsConsoleApp1,代码行数:12,代码来源:Program.cs


示例3: GetData

        public static void GetData(string UID, string tableName)
        {
            Table testDB = Table.LoadTable(client, tableName);
            var request = new Amazon.DynamoDBv2.Model.GetItemRequest
            {
                TableName = tableName,
                Key = new Dictionary<string,Amazon.DynamoDBv2.Model.AttributeValue>()
                {{"UID",new Amazon.DynamoDBv2.Model.AttributeValue{S=UID}}}

            };

            var response = client.GetItem(request);
            var result = response.GetItemResult;
            Console.WriteLine("Units");
            Console.WriteLine(response.GetItemResult.ConsumedCapacity.CapacityUnits);
            Console.WriteLine("Data");
            Console.WriteLine(response.GetItemResult.Item.Count);
            Console.ReadLine();
        }
开发者ID:ChunTaiChen,项目名称:AwsConsoleApp1,代码行数:19,代码来源:Program.cs


示例4: CheckUserIsExist

        public bool CheckUserIsExist(string userID)
        {
            var config = new AmazonDynamoDBConfig();
            GetItemResponse response;
            config.ServiceURL = System.Configuration.ConfigurationManager.AppSettings["ServiceURL"];
            client = new AmazonDynamoDBClient(config);
            bool retval = false;
            try
            {
                GetItemRequest request = new GetItemRequest
                {
                    TableName = "User",
                    Key = new Dictionary<string, AttributeValue>() { { "UserID", new AttributeValue { S = userID } } },
                    ReturnConsumedCapacity = "TOTAL"
                };
                response = client.GetItem(request);
                retval = response.Item.Count > 0;
            }
            catch (AmazonDynamoDBException e) { Console.WriteLine(e.Message); }
            catch (AmazonServiceException e) { Console.WriteLine(e.Message); }
            catch (Exception e) { Console.WriteLine(e.Message); }

            return retval;
        }
开发者ID:EchoPan,项目名称:BreadcrumbAPI,代码行数:24,代码来源:DataHelper.cs


示例5: BeginGetItem

 /// <summary>
 /// Initiates the asynchronous execution of the GetItem operation.
 /// <seealso cref="Amazon.DynamoDBv2.AmazonDynamoDB.GetItem"/>
 /// </summary>
 /// 
 /// <param name="getItemRequest">Container for the necessary parameters to execute the GetItem operation on AmazonDynamoDBv2.</param>
 /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
 /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 /// 
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetItem
 ///         operation.</returns>
 public IAsyncResult BeginGetItem(GetItemRequest getItemRequest, AsyncCallback callback, object state)
 {
     return invokeGetItem(getItemRequest, callback, state, false);
 }
开发者ID:pbutlerm,项目名称:dataservices-sdk-dotnet,代码行数:16,代码来源:AmazonDynamoDBClient.cs


示例6: GetItem

 /// <summary>
 /// The <i>GetItem</i> operation returns a set of attributes for the item with the given
 /// primary key. If there is no matching item, <i>GetItem</i> does not return any data.
 /// 
 ///  
 /// <para>
 /// <i>GetItem</i> provides an eventually consistent read by default. If your application
 /// requires a strongly consistent read, set <i>ConsistentRead</i> to <code>true</code>.
 /// Although a strongly consistent read might take more time than an eventually consistent
 /// read, it always returns the last updated value.
 /// </para>
 /// </summary>
 /// <param name="tableName">The name of the table containing the requested item.</param>
 /// <param name="key">A map of attribute names to <i>AttributeValue</i> objects, representing the primary key of the item to retrieve. For the primary key, you must provide all of the attributes. For example, with a hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.</param>
 /// <param name="consistentRead">A value that if set to <code>true</code>, then the operation uses strongly consistent reads; otherwise, eventually consistent reads are used.</param>
 /// 
 /// <returns>The response from the GetItem service method, as returned by DynamoDB.</returns>
 /// <exception cref="Amazon.DynamoDBv2.Model.InternalServerErrorException">
 /// An error occurred on the server side.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ProvisionedThroughputExceededException">
 /// The request rate is too high, or the request is too large, for the available throughput
 /// to accommodate. The AWS SDKs automatically retry requests that receive this exception;
 /// therefore, your request will eventually succeed, unless the request is too large or
 /// your retry queue is too large to finish. Reduce the frequency of requests by using
 /// the strategies listed in <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#APIRetries">Error
 /// Retries and Exponential Backoff</a> in the <i>Amazon DynamoDB Developer Guide</i>.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ResourceNotFoundException">
 /// The operation tried to access a nonexistent table or index. The resource might not
 /// be specified correctly, or its status might not be <code>ACTIVE</code>.
 /// </exception>
 public GetItemResponse GetItem(string tableName, Dictionary<string, AttributeValue> key, bool consistentRead)
 {
     var request = new GetItemRequest();
     request.TableName = tableName;
     request.Key = key;
     request.ConsistentRead = consistentRead;
     return GetItem(request);
 }
开发者ID:JonathanHenson,项目名称:aws-sdk-net,代码行数:40,代码来源:AmazonDynamoDBClient.cs


示例7: invokeGetItem

 IAsyncResult invokeGetItem(GetItemRequest getItemRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new GetItemRequestMarshaller().Marshall(getItemRequest);
     var unmarshaller = GetItemResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
开发者ID:pbutlerm,项目名称:dataservices-sdk-dotnet,代码行数:8,代码来源:AmazonDynamoDBClient.cs


示例8: GetItemAsync

        /// <summary>
        /// <para>The <i>GetItem</i> operation returns a set of attributes for the item with the given primary key. If there is no matching item,
        /// <i>GetItem</i> does not return any data.</para> <para> <i>GetItem</i> provides an eventually consistent read by default. If your application
        /// requires a strongly consistent read, set <i>ConsistentRead</i> to <c>true</c> . Although a strongly consistent read might take more time
        /// than an eventually consistent read, it always returns the last updated value.</para>
        /// </summary>
        /// 
        /// <param name="getItemRequest">Container for the necessary parameters to execute the GetItem service method on AmazonDynamoDBv2.</param>
        /// 
        /// <returns>The response from the GetItem service method, as returned by AmazonDynamoDBv2.</returns>
        /// 
        /// <exception cref="T:Amazon.DynamoDBv2.Model.ResourceNotFoundException" />
        /// <exception cref="T:Amazon.DynamoDBv2.Model.ProvisionedThroughputExceededException" />
        /// <exception cref="T:Amazon.DynamoDBv2.Model.InternalServerErrorException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<GetItemResponse> GetItemAsync(GetItemRequest getItemRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, GetItemRequest, GetItemResponse>(getItemRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
开发者ID:jeffersonjhunt,项目名称:aws-sdk-net,代码行数:23,代码来源:AmazonDynamoDBClient.cs


示例9: GetItemAsync

 /// <summary>
 /// The <i>GetItem</i> operation returns a set of attributes for the item with the given
 /// primary key. If there is no matching item, <i>GetItem</i> does not return any data.
 /// 
 ///  
 /// <para>
 /// <i>GetItem</i> provides an eventually consistent read by default. If your application
 /// requires a strongly consistent read, set <i>ConsistentRead</i> to <code>true</code>.
 /// Although a strongly consistent read might take more time than an eventually consistent
 /// read, it always returns the last updated value.
 /// </para>
 /// </summary>
 /// <param name="tableName">The name of the table containing the requested item.</param>
 /// <param name="key">A map of attribute names to <i>AttributeValue</i> objects, representing the primary key of the item to retrieve. For the primary key, you must provide all of the attributes. For example, with a hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.</param>
 /// <param name="consistentRead">Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.</param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the GetItem service method, as returned by DynamoDB.</returns>
 /// <exception cref="Amazon.DynamoDBv2.Model.InternalServerErrorException">
 /// An error occurred on the server side.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ProvisionedThroughputExceededException">
 /// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry requests
 /// that receive this exception. Your request is eventually successful, unless your retry
 /// queue is too large to finish. Reduce the frequency of requests and use exponential
 /// backoff. For more information, go to <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#APIRetries">Error
 /// Retries and Exponential Backoff</a> in the <i>Amazon DynamoDB Developer Guide</i>.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ResourceNotFoundException">
 /// The operation tried to access a nonexistent table or index. The resource might not
 /// be specified correctly, or its status might not be <code>ACTIVE</code>.
 /// </exception>
 public Task<GetItemResponse> GetItemAsync(string tableName, Dictionary<string, AttributeValue> key, bool consistentRead, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new GetItemRequest();
     request.TableName = tableName;
     request.Key = key;
     request.ConsistentRead = consistentRead;
     return GetItemAsync(request, cancellationToken);
 }
开发者ID:rajdotnet,项目名称:aws-sdk-net,代码行数:42,代码来源:AmazonDynamoDBClient.cs


示例10: GetItem

		internal GetItemResponse GetItem(GetItemRequest request)
        {
            var task = GetItemAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
开发者ID:jeffersonjhunt,项目名称:aws-sdk-net,代码行数:13,代码来源:AmazonDynamoDBClient.cs


示例11: GetItemAsync

        /// <summary>
        /// Initiates the asynchronous execution of the GetItem operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetItem operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<GetItemResponse> GetItemAsync(GetItemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.Instance;

            return InvokeAsync<GetItemRequest,GetItemResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
开发者ID:sadiqj,项目名称:aws-sdk-xamarin,代码行数:18,代码来源:_AmazonDynamoDBClient.cs


示例12: GetItemAsync

 /// <summary>
 /// The <i>GetItem</i> operation returns a set of attributes for the item with the given
 /// primary key. If there is no matching item, <i>GetItem</i> does not return any data.
 /// 
 ///  
 /// <para>
 /// <i>GetItem</i> provides an eventually consistent read by default. If your application
 /// requires a strongly consistent read, set <i>ConsistentRead</i> to <code>true</code>.
 /// Although a strongly consistent read might take more time than an eventually consistent
 /// read, it always returns the last updated value.
 /// </para>
 /// </summary>
 /// <param name="tableName">The name of the table containing the requested item.</param>
 /// <param name="key">A map of attribute names to <i>AttributeValue</i> objects, representing the primary key of the item to retrieve. For the primary key, you must provide all of the attributes. For example, with a hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.</param>
 /// <param name="consistentRead">A value that if set to <code>true</code>, then the operation uses strongly consistent reads; otherwise, eventually consistent reads are used.</param>
 /// 
 /// <returns>The response from the GetItem service method, as returned by DynamoDB.</returns>
 /// <exception cref="Amazon.DynamoDBv2.Model.InternalServerErrorException">
 /// An error occurred on the server side.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ProvisionedThroughputExceededException">
 /// The request rate is too high, or the request is too large, for the available throughput
 /// to accommodate. The AWS SDKs automatically retry requests that receive this exception;
 /// therefore, your request will eventually succeed, unless the request is too large or
 /// your retry queue is too large to finish. Reduce the frequency of requests by using
 /// the strategies listed in <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#APIRetries">Error
 /// Retries and Exponential Backoff</a> in the <i>Amazon DynamoDB Developer Guide</i>.
 /// </exception>
 /// <exception cref="Amazon.DynamoDBv2.Model.ResourceNotFoundException">
 /// The operation tried to access a nonexistent table or index. The resource might not
 /// be specified correctly, or its status might not be <code>ACTIVE</code>.
 /// </exception>
 public void GetItemAsync(string tableName, Dictionary<string, AttributeValue> key, bool consistentRead, AmazonServiceCallback<GetItemRequest, GetItemResponse> callback, AsyncOptions options = null)
 {
     var request = new GetItemRequest();
     request.TableName = tableName;
     request.Key = key;
     request.ConsistentRead = consistentRead;
     GetItemAsync(request, callback, options);
 }
开发者ID:johnryork,项目名称:aws-sdk-unity,代码行数:40,代码来源:AmazonDynamoDBClient.cs


示例13: GetUser

        public Dictionary<string, object> GetUser(string userID)
        {
            Dictionary<string, object> retval = new Dictionary<string, object>();
            GetItemResponse response;
            var config = new AmazonDynamoDBConfig();
            config.ServiceURL = System.Configuration.ConfigurationManager.AppSettings["ServiceURL"];
            client = new AmazonDynamoDBClient(config);
            try
            {
                GetItemRequest request = new GetItemRequest
                {
                    TableName = "User",
                    Key = new Dictionary<string, AttributeValue>() { { "UserID", new AttributeValue { S = userID } } },
                    ReturnConsumedCapacity = "TOTAL"
                };
                response = client.GetItem(request);
                retval.Add("UserID", response.Item["UserID"].S);
                retval.Add("HeadshotURL", response.Item["HeadshotURL"].S);
                retval.Add("IsPayUser", Convert.ToBoolean(response.Item["IsPayUser"].S));
                retval.Add("UserName", response.Item["UserName"].S);
                retval.Add("RegistDate", response.Item["RegistDate"].N);
                retval.Add("LastLoginDate", response.Item["LastLoginDate"].N);
                retval.Add("LastSyncDate", response.Item["LastSyncDate"].N);
            }
            catch (AmazonDynamoDBException e) { Console.WriteLine(e.Message); }
            catch (AmazonServiceException e) { Console.WriteLine(e.Message); }
            catch (Exception e) { Console.WriteLine(e.Message); }

            return retval;
        }
开发者ID:EchoPan,项目名称:BreadcrumbAPI,代码行数:30,代码来源:DataHelper.cs


示例14: GetItem

 /// <summary>
 /// <para>The <i>GetItem</i> operation returns a set of attributes for the item with the given primary key. If there is no matching item,
 /// <i>GetItem</i> does not return any data.</para> <para> <i>GetItem</i> provides an eventually consistent read by default. If your application
 /// requires a strongly consistent read, set <i>ConsistentRead</i> to <c>true</c> . Although a strongly consistent read might take more time
 /// than an eventually consistent read, it always returns the last updated value.</para>
 /// </summary>
 /// 
 /// <param name="getItemRequest">Container for the necessary parameters to execute the GetItem service method on AmazonDynamoDBv2.</param>
 /// 
 /// <returns>The response from the GetItem service method, as returned by AmazonDynamoDBv2.</returns>
 /// 
 /// <exception cref="ResourceNotFoundException"/>
 /// <exception cref="ProvisionedThroughputExceededException"/>
 /// <exception cref="InternalServerErrorException"/>
 public GetItemResponse GetItem(GetItemRequest getItemRequest)
 {
     IAsyncResult asyncResult = invokeGetItem(getItemRequest, null, null, true);
     return EndGetItem(asyncResult);
 }
开发者ID:pbutlerm,项目名称:dataservices-sdk-dotnet,代码行数:19,代码来源:AmazonDynamoDBClient.cs


示例15: GetItemHelper

        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
            };
            request.BeforeRequestEvent += isAsync ?
                new RequestEventHandler(UserAgentRequestEventHandlerAsync) :
                new RequestEventHandler(UserAgentRequestEventHandlerSync);
            if (currentConfig.AttributesToGet != null)
                request.WithAttributesToGet(currentConfig.AttributesToGet);

            var result = DDBClient.GetItem(request);
            var attributeMap = result.GetItemResult.Item;
            if (attributeMap == null)
                return null;
            return Document.FromAttributeMap(attributeMap);
        }
开发者ID:skilitics,项目名称:aws-sdk-net,代码行数:21,代码来源:Table.cs


示例16: Get_item_with_AWSSDK

        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();
        }
开发者ID:derFunk,项目名称:ServiceStack.Aws,代码行数:24,代码来源:DynamoDbTodoExample.cs


示例17: GetItemAsync

        /// <summary>
        /// Initiates the asynchronous execution of the GetItem operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB.GetItem"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetItem operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
		public async Task<GetItemResponse> GetItemAsync(GetItemRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, GetItemRequest, GetItemResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
开发者ID:rinselmann,项目名称:aws-sdk-net,代码行数:18,代码来源:AmazonDynamoDBClient.cs


示例18: CRUDSamples

        public void CRUDSamples()
        {
            EnsureTables();

            PutSample();

            {
                #region GetItem Sample

                // Create a client
                AmazonDynamoDBClient client = new AmazonDynamoDBClient();

                // Define item key
                //  Hash-key of the target item is string value "Mark Twain"
                //  Range-key of the target item is string value "The Adventures of Tom Sawyer"
                Dictionary<string, AttributeValue> key = new Dictionary<string, AttributeValue>
                {
                    { "Author", new AttributeValue { S = "Mark Twain" } },
                    { "Title", new AttributeValue { S = "The Adventures of Tom Sawyer" } }
                };

                // Create GetItem request
                GetItemRequest request = new GetItemRequest
                {
                    TableName = "SampleTable",
                    Key = key,
                };

                // Issue request
                var result = client.GetItem(request);

                // View response
                Console.WriteLine("Item:");
                Dictionary<string, AttributeValue> item = result.Item;
                foreach (var keyValuePair in item)
                {
                    Console.WriteLine("{0} : S={1}, N={2}, SS=[{3}], NS=[{4}]",
                        keyValuePair.Key,
                        keyValuePair.Value.S,
                        keyValuePair.Value.N,
                        string.Join(", ", keyValuePair.Value.SS ?? new List<string>()),
                        string.Join(", ", keyValuePair.Value.NS ?? new List<string>()));
                }

                #endregion
            }

            {
                #region UpdateItem Sample

                // Create a client
                AmazonDynamoDBClient client = new AmazonDynamoDBClient();

                // Define item key
                //  Hash-key of the target item is string value "Mark Twain"
                //  Range-key of the target item is string value "The Adventures of Tom Sawyer"
                Dictionary<string, AttributeValue> key = new Dictionary<string, AttributeValue>
                {
                    { "Author", new AttributeValue { S = "Mark Twain" } },
                    { "Title", new AttributeValue { S = "The Adventures of Tom Sawyer" } }
                };

                // Define attribute updates
                Dictionary<string, AttributeValueUpdate> updates = new Dictionary<string, AttributeValueUpdate>();
                // Update item's Setting attribute
                updates["Setting"] = new AttributeValueUpdate()
                {
                    Action = AttributeAction.PUT,
                    Value = new AttributeValue { S = "St. Petersburg, Missouri" }
                };
                // Remove item's Bibliography attribute
                updates["Bibliography"] = new AttributeValueUpdate()
                {
                    Action = AttributeAction.DELETE
                };   
                // Add a new string to the item's Genres SS attribute
                updates["Genres"] = new AttributeValueUpdate()
                {
                    Action = AttributeAction.ADD,
                    Value = new AttributeValue { SS = new List<string> { "Bildungsroman" } }
                };

                // Create UpdateItem request
                UpdateItemRequest request = new UpdateItemRequest
                {
                    TableName = "SampleTable",
                    Key = key,
                    AttributeUpdates = updates
                };

                // Issue request
                client.UpdateItem(request);

                #endregion
            }

            {
                #region DeleteItem Sample

                // Create a client
//.........这里部分代码省略.........
开发者ID:rajdotnet,项目名称:aws-sdk-net,代码行数:101,代码来源:LowLevelSamples.cs


示例19: GetItem

        internal GetItemResponse GetItem(GetItemRequest request)
        {
            var marshaller = new GetItemRequestMarshaller();
            var unmarshaller = GetItemResponseUnmarshaller.Instance;

            return Invoke<GetItemRequest,GetItemResponse>(request, marshaller, unmarshaller);
        }
开发者ID:sadiqj,项目名称:aws-sdk-xamarin,代码行数:7,代码来源:_AmazonDynamoDBClient.cs


示例20: GetItem

		internal GetItemResponse GetItem(GetItemRequest request)
        {
            var task = GetItemAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
开发者ID:scopely,项目名称:aws-sdk-net,代码行数:12,代码来源:AmazonDynamoDBClient.cs



注:本文中的Amazon.DynamoDBv2.Model.GetItemRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Model.ListTablesRequest类代码示例发布时间:2022-05-24
下一篇:
C# Model.DeleteItemRequest类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap