meine Methode:C# kann nicht implizit Typ T umwandeln T eingeben
public TableFilled<TKey, TRow> getTera()
{
Func<TablesFilled<TKey,TRow>> _getTera=new Func<TablesFilled<TKey,TRow>>(
()=>{return (TablesFilled<TKey,TRow>) chGetTera();});
//Above does not compile says: Cannot convert type
//'AcapsVerify.FunctionalTables.TableFilled<TKey,TRow>' to
//'AcapsVerify.FunctionalTables.TablesFilled<TKey,TRow>'
// the line below has the same blue underline error.
return _getTera.TimeAndReport("Finished Teradata",OutputIfListener);
// this works fine
return chGetTera;
}
Die statische Methode ruft
public static T TimeAndReport<T>(this Func<T> timedFunc, String reportLead, Action<String> reporterAction)
{
T result;
var s = new System.Diagnostics.Stopwatch();
s.Start();
result = timedFunc();
s.Stop();
reporterAction(reportLead + " in " + s.WholePartOnly());
return result;
}
Rückkehr Klassendefinition:
public class TableFilled<TKey,TRow> where TRow: STeraRow<TKey>
Um dies zu in mehr Kontext zu setzen, ich mache ein Funktionstisch Vergleichsprogramm, wo man die Tabelle Master ist und eine ist die Kopie . Funktionell unterscheidet sich eine gefüllte Tabelle von der Klasse, die sie erstellt. Ich möchte, dass alle Tischfabriken berichten, wie lange sie gedauert haben, wenn jemand zuhört. – Maslow