System.Data.DataRow クラスを拡張したいので、次のコードを作成しました (そしてusing
、クラスにキーワードを追加しました)。
namespace MyExtension
{
public static class DataRowExt
{
public static string ToNullableDate(this DataRow dr)
{ return something;}
}
}
ただし、次のコードを試すと、ToNullableDate
Intellisense に表示されません。
DataRow d = new DataRow();
d["Column"].ToNullableDate(); // ToNullableDate does not show up
拡張メソッド ステートメントに欠けているものはありますか? または、新しいクラスを作成して、代わりに DataRow クラスから継承する必要がありますか?
ありがとう