You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
399 B
C#
18 lines
399 B
C#
using System.Collections.Generic;
|
|
|
|
namespace EntrustSettle.Common.Extensions;
|
|
|
|
public static class UntilExtensions
|
|
{
|
|
public static void AddOrModify<TKey, TValue>(this IDictionary<TKey, TValue> dic, TKey key, TValue value)
|
|
{
|
|
if (dic.TryGetValue(key, out _))
|
|
{
|
|
dic[key] = value;
|
|
}
|
|
else
|
|
{
|
|
dic.Add(key, value);
|
|
}
|
|
}
|
|
} |