このクラス プロパティは、インターフェイスにリファクタリングしようとしているものです。
public class Stuff : IStuff {
public int Number {
get;
protected internal set;
}
}
Visual Studio 2008 リファクタリング ツールは、次のインターフェイスを抽出します
// Visual Studio 2008's attempt is:
public interface IStuff {
int Number { get; }
}
C# コンパイラは次のエラーを訴えます。
'Stuff.Number.set' adds an accessor not found in interface member 'IStuff.DataOperations'
(これは、Visual Studio が不適切なコンパイル状況を引き起こすコードを生成する状況に遭遇した数少ない状況の 1 つです。)
この 1 つのプロパティをインターフェイスに抽出する直接的な解決策はありますか?