I have a function used when calling a service. Before it call the service, it will create a log entry:
protected TResult CallService<TService, TResult>(TService service,
Expression<Func<TService, TResult>> functionSelector)
{
Logger.LogServiceCall(service, functionSelector);
return functionSelector.Compile()(service);
}
The Visual Studio 2010 Code Analyzer informs me that I shouldn't use Nested Type in the following message:
CA1006 : Microsoft.Design : Consider a
design where
'ServiceManager.CallService<TService,
Result>(TService,
Expression<Func<TService, TResult>>)'
doesn't nest generic type
'Expression<Func<TService, TResult>>'.
While I could simply create a suppression rule for this entry, is there is an alternative that exist that would prevent displaying such warning?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…