I have the following interface
public interface IMyInterface
{
DataItem<decimal?> MyProperty { get; }
}
And the DataItem
class looks something like this
public class DataItem<T>
{
private readonly string _name;
public DataItem(string name)
{
this._name = name;
}
public string Name
{
get
{
return _name;
}
}
public T Value { get; set; }
}
When I run code analysis I get the warning
CA1006 Do not nest generic types in member signatures Consider a design where 'IMyInterface.MyProperty ' doesn't nest generic type 'DataItem<decimal?>'.
In the MDSN documentation I am told
Do not suppress a warning from this rule.
I am generally inclined to follow the guidelines. So how would I refactor my interface (or DataItem
class) to follow these guidelines? Or is it more of a redesign than refactor?