Dictionary 使用
using System.Collections.Generic;
Create Dictionary
Dictionary<decimal, int> dicCIUType = new Dictionary<decimal, int>();
Add to Dictionary
dicCIUType.Add(id, Type);
Search in Dictionary
foreach (KeyValuePair<decimal, int> kvp in dic)
{
if (kvp.Key == id)
{
continue;
}
if (kvp.Value == Type)
{
return false;
}
}