@@ -115,7 +115,7 @@ public Condition ToCondition(DynamoDBEntryConversion conversion, bool shouldConv
115
115
/// <returns></returns>
116
116
public Condition ToCondition ( DynamoDBEntryConversion conversion , bool shouldConvertToEpochSeconds , string attributeName )
117
117
{
118
- return ToCondition ( conversion , shouldConvertToEpochSeconds , attributeName , false ) ;
118
+ return ToCondition ( conversion , shouldConvertToEpochSeconds , false , attributeName , false ) ;
119
119
}
120
120
121
121
/// <summary>
@@ -128,6 +128,46 @@ public Condition ToCondition(DynamoDBEntryConversion conversion, bool shouldConv
128
128
/// <returns></returns>
129
129
public Condition ToCondition ( DynamoDBEntryConversion conversion , bool shouldConvertToEpochSeconds ,
130
130
string attributeName , bool isEmptyStringValueEnabled )
131
+ {
132
+ return ToCondition ( conversion , shouldConvertToEpochSeconds , false , attributeName , isEmptyStringValueEnabled ) ;
133
+ }
134
+
135
+ /// <summary>
136
+ /// Converts the FilterCondition to the Amazon.DynamoDBv2.Model.Condition object.
137
+ /// </summary>
138
+ /// <param name="conversion"></param>
139
+ /// <param name="shouldConvertToEpochSeconds"></param>
140
+ /// <param name="shouldConvertToEpochSecondsLong"></param>
141
+ /// <returns></returns>
142
+ public Condition ToCondition ( DynamoDBEntryConversion conversion , bool shouldConvertToEpochSeconds , bool shouldConvertToEpochSecondsLong )
143
+ {
144
+ return ToCondition ( conversion , shouldConvertToEpochSeconds : false , attributeName : null , isEmptyStringValueEnabled : shouldConvertToEpochSeconds ) ;
145
+ }
146
+
147
+ /// <summary>
148
+ /// Converts the FilterCondition to the Amazon.DynamoDBv2.Model.Condition object.
149
+ /// </summary>
150
+ /// <param name="conversion"></param>
151
+ /// <param name="shouldConvertToEpochSeconds"></param>
152
+ /// <param name="shouldConvertToEpochSecondsLong"></param>
153
+ /// <param name="attributeName"></param>
154
+ /// <returns></returns>
155
+ public Condition ToCondition ( DynamoDBEntryConversion conversion , bool shouldConvertToEpochSeconds , bool shouldConvertToEpochSecondsLong , string attributeName )
156
+ {
157
+ return ToCondition ( conversion , shouldConvertToEpochSeconds , attributeName , false ) ;
158
+ }
159
+
160
+ /// <summary>
161
+ /// Converts the FilterCondition to the Amazon.DynamoDBv2.Model.Condition object.
162
+ /// </summary>
163
+ /// <param name="conversion"></param>
164
+ /// <param name="shouldConvertToEpochSeconds"></param>
165
+ /// <param name="shouldConvertToEpochSecondsLong"></param>
166
+ /// <param name="attributeName"></param>
167
+ /// <param name="isEmptyStringValueEnabled"></param>
168
+ /// <returns></returns>
169
+ public Condition ToCondition ( DynamoDBEntryConversion conversion , bool shouldConvertToEpochSeconds , bool shouldConvertToEpochSecondsLong ,
170
+ string attributeName , bool isEmptyStringValueEnabled )
131
171
{
132
172
var attributeValues = AttributeValues ;
133
173
if ( attributeValues == null )
@@ -138,7 +178,10 @@ public Condition ToCondition(DynamoDBEntryConversion conversion, bool shouldConv
138
178
var entry = DynamoDBEntries [ i ] ;
139
179
if ( shouldConvertToEpochSeconds )
140
180
entry = Document . DateTimeToEpochSeconds ( entry , attributeName ) ;
141
-
181
+
182
+ if ( shouldConvertToEpochSecondsLong )
183
+ entry = Document . DateTimeToEpochSecondsLong ( entry , attributeName ) ;
184
+
142
185
var attributeConversionConfig = new DynamoDBEntry . AttributeConversionConfig ( conversion , isEmptyStringValueEnabled ) ;
143
186
var attributeValue = entry . ConvertToAttributeValue ( attributeConversionConfig ) ;
144
187
attributeValues . Add ( attributeValue ) ;
@@ -192,7 +235,7 @@ public Dictionary<string, Condition> ToConditions()
192
235
/// <returns>Map from attribute name to condition</returns>
193
236
public Dictionary < string , Condition > ToConditions ( DynamoDBEntryConversion conversion )
194
237
{
195
- return ToConditions ( conversion , epochAttributes : null , isEmptyStringValueEnabled : false ) ;
238
+ return ToConditions ( conversion , epochAttributes : null , epochLongAttributes : null , isEmptyStringValueEnabled : false ) ;
196
239
}
197
240
198
241
/// <summary>
@@ -203,7 +246,7 @@ public Dictionary<string, Condition> ToConditions(DynamoDBEntryConversion conver
203
246
/// <returns>Map from attribute name to condition</returns>
204
247
public Dictionary < string , Condition > ToConditions ( DynamoDBEntryConversion conversion , bool isEmptyStringValueEnabled )
205
248
{
206
- return ToConditions ( conversion , epochAttributes : null , isEmptyStringValueEnabled : isEmptyStringValueEnabled ) ;
249
+ return ToConditions ( conversion , epochAttributes : null , epochLongAttributes : null , isEmptyStringValueEnabled : isEmptyStringValueEnabled ) ;
207
250
}
208
251
209
252
/// <summary>
@@ -213,19 +256,20 @@ public Dictionary<string, Condition> ToConditions(DynamoDBEntryConversion conver
213
256
/// <returns>Map from attribute name to condition</returns>
214
257
public Dictionary < string , Condition > ToConditions ( Table table )
215
258
{
216
- return ToConditions ( table . Conversion , table . StoreAsEpoch , table . IsEmptyStringValueEnabled ) ;
259
+ return ToConditions ( table . Conversion , table . StoreAsEpoch , table . StoreAsEpochLong , table . IsEmptyStringValueEnabled ) ;
217
260
}
218
261
219
262
private Dictionary < string , Condition > ToConditions ( DynamoDBEntryConversion conversion ,
220
- IEnumerable < string > epochAttributes , bool isEmptyStringValueEnabled )
263
+ IEnumerable < string > epochAttributes , IEnumerable < string > epochLongAttributes , bool isEmptyStringValueEnabled )
221
264
{
222
265
var dic = new Dictionary < string , Condition > ( ) ;
223
266
foreach ( var kvp in Conditions )
224
267
{
225
268
string name = kvp . Key ;
226
269
FilterCondition fc = kvp . Value ;
227
270
bool convertToEpochSeconds = epochAttributes != null && epochAttributes . Contains ( name ) ;
228
- Condition condition = fc . ToCondition ( conversion , convertToEpochSeconds , name , isEmptyStringValueEnabled ) ;
271
+ bool convertToEpochSecondsLong = epochLongAttributes != null && epochLongAttributes . Contains ( name ) ;
272
+ Condition condition = fc . ToCondition ( conversion , convertToEpochSeconds , convertToEpochSecondsLong , name , isEmptyStringValueEnabled ) ;
229
273
230
274
dic [ name ] = condition ;
231
275
}
0 commit comments