/// <summary> /// Initiates a Search object to Scan a DynamoDB table, with the /// specified config. /// /// No calls are made until the Search object is used. /// </summary> /// <param name="config">Configuration to use.</param> /// <returns>Resultant Search container.</returns> public Search Scan(ScanOperationConfig config) { var currentConfig = config ?? new ScanOperationConfig(); Search ret = new Search(SearchType.Scan); ret.SourceTable = this; ret.TableName = TableName; ret.Limit = currentConfig.Limit; ret.Filter = currentConfig.Filter; ret.AttributesToGet = currentConfig.AttributesToGet; return ret; }
/// <summary> /// Initiates a Search object to Query a DynamoDB table, with the /// specified config. /// /// No calls are made until the Search object is used. /// </summary> /// <param name="config">Configuration to use.</param> /// <returns>Resultant Search container.</returns> public Search Query(QueryOperationConfig config) { if (config == null) throw new ArgumentNullException("config"); if (config.HashKey == null) throw new ArgumentNullException("config.HashKey"); Search ret = new Search(SearchType.Query); ret.SourceTable = this; ret.TableName = TableName; ret.HashKey = config.HashKey.ConvertToAttributeValue(); ret.AttributesToGet = config.AttributesToGet; ret.Filter = config.Filter; ret.Limit = config.Limit; ret.IsConsistentRead = config.ConsistentRead; ret.IsBackwardSearch = config.BackwardSearch; return ret; }