mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-08 01:21:13 +00:00

* add IHandle for object type * rename handle -> handleObject * remove duplicate file header setting * update * remove AgentId * fix format
19 lines
489 B
C#
19 lines
489 B
C#
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// ParseExtensions.cs
|
|
|
|
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;
|
|
}
|
|
}
|