私はそのようなコードを持っています:
using System.Collections.Generic;
using System.Linq;
namespace PricingCoefficientService.Extensions
{
public static class IntExt
{
public static bool IsIn(this int integer, IEnumerable<int> collectionOfIntegers)
{
return collectionOfIntegers.Contains(integer);
}
}
}
intを拡張した拡張メソッドです。その機能は明らかだと思います。
しかし、値の型やオブジェクトごとに使用できるようにするためにジェネリックにしたくない場合はどうすればよいでしょうか?
何か案が?
ありがとうございました