You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ParseExtensions.cs 455 B

1234567891011121314151617
  1. // Copyright (c) Microsoft. All rights reserved.
  2. namespace DevTeam;
  3. public static class ParseExtensions
  4. {
  5. public static long TryParseLong(this Dictionary<string, string> data, string key)
  6. {
  7. ArgumentNullException.ThrowIfNull(data);
  8. if (data.TryGetValue(key, out string? value) && !string.IsNullOrEmpty(value) && long.TryParse(value, out var result))
  9. {
  10. return result;
  11. }
  12. return default;
  13. }
  14. }