@@ -252,6 +252,48 @@ public static void SetInteger(
252
252
isDirty , true
253
253
) ;
254
254
255
+ /*==========================================================================================================================
256
+ | METHOD: SET DOUBLE
257
+ \-------------------------------------------------------------------------------------------------------------------------*/
258
+ /// <summary>
259
+ /// Helper method that either adds a new <see cref="AttributeValue"/> object or updates the value of an existing one,
260
+ /// depending on whether that value already exists.
261
+ /// </summary>
262
+ /// <param name="attributes">The instance of the <see cref="AttributeValueCollection"/> this extension is bound to.</param>
263
+ /// <param name="key">The string identifier for the <see cref="AttributeValue"/>.</param>
264
+ /// <param name="value">The double value for the <see cref="AttributeValue"/>.</param>
265
+ /// <param name="isDirty">
266
+ /// Specified whether the value should be marked as <see cref="AttributeValue.IsDirty"/>. By default, it will be marked as
267
+ /// dirty if the value is new or has changed from a previous value. By setting this parameter, that behavior is
268
+ /// overwritten to accept whatever value is submitted. This can be used, for instance, to prevent an update from being
269
+ /// persisted to the data store on <see cref="ITopicRepository.Save(Topic, Boolean, Boolean)"/>.
270
+ /// </param>
271
+ /// <requires
272
+ /// description="The key must be specified for the AttributeValue key/value pair."
273
+ /// exception="T:System.ArgumentNullException">
274
+ /// !String.IsNullOrWhiteSpace(key)
275
+ /// </requires>
276
+ /// <requires
277
+ /// description="The value must be specified for the AttributeValue key/value pair."
278
+ /// exception="T:System.ArgumentNullException">
279
+ /// !String.IsNullOrWhiteSpace(value)
280
+ /// </requires>
281
+ /// <requires
282
+ /// description="The key should be an alphanumeric sequence; it should not contain spaces or symbols"
283
+ /// exception="T:System.ArgumentException">
284
+ /// !value.Contains(" ")
285
+ /// </requires>
286
+ public static void SetDouble (
287
+ this AttributeValueCollection attributes ,
288
+ string key ,
289
+ double value ,
290
+ bool ? isDirty = null
291
+ ) => attributes ? . SetValue (
292
+ key ,
293
+ value . ToString ( CultureInfo . InvariantCulture ) ,
294
+ isDirty , true
295
+ ) ;
296
+
255
297
/*==========================================================================================================================
256
298
| METHOD: SET DATETIME
257
299
\-------------------------------------------------------------------------------------------------------------------------*/
0 commit comments