You can not 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
397 B

using System.Collections.Generic;
namespace Tiobon.Core.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);
}
}
}