Xiaoyun Zhang 6bea055b26
[.Net] Add a generic IHandle interface so AgentRuntime doesn't need to deal with typed handler (#3985)
* add IHandle for object type

* rename handle -> handleObject

* remove duplicate file header setting

* update

* remove AgentId

* fix format
2024-10-30 11:53:37 -07:00

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;
}
}