Out of curiosity i would like to know how to best implement a class that could be used to avoid the CA1006 warning
CA1006 : Microsoft.Design : Consider a design where 'IReader.Query(String, String)' doesn't nest generic type 'IList(Of IDictionary(Of String, Object))'.
This is the method that returns the generic type
public virtual IList<IDictionary<string, object>> Query(
string fullFileName,
string sheetName)
{
using (var connection = new OdbcConnection(
this.GetOdbcConnectionString(fullFileName)))
{
connection.Open();
return connection
.Query(string.Format(
CultureInfo.InvariantCulture,
SystemResources.ExcelReader_Query_select_top_128___from__0_,
sheetName))
.Cast<IDictionary<string, object>>()
.ToList();
}
}
Something like
SourceData<T, U> Query(string fullFileName, string sheetName)
SourceData Query(string fullFileName, string sheetName)
EDIT:
Following Marc's suggestions I encapsulated the nested generic in this class
public class QueryRow : List<KeyValuePair<string, object>>
{
protected internal QueryRow(IEnumerable<KeyValuePair<string, object>> dictionary)
{
this.AddRange(dictionary.Select(kvp => kvp));
}
}