Xiaoyun Zhang 9ba14ee15b
Fix dotnet test and reformat dotnet code (#3603)
* fix test

* install aspire workload

* format

* fix build error

* fix format

* format
2024-10-02 14:42:27 -04:00

18 lines
455 B
C#

// Copyright (c) Microsoft. All rights reserved.
namespace DevTeam;
public static class ParseExtensions
{
public static long TryParseLong(this Dictionary<string, string> data, string key)
{
ArgumentNullException.ThrowIfNull(data);
if (data.TryGetValue(key, out string? value) && !string.IsNullOrEmpty(value) && long.TryParse(value, out var result))
{
return result;
}
return default;
}
}