我想在Mono上构建this repository的PostgreSqlGeneration
代码。不幸的是,我收到了一个我不明白的错误。代表System.Action <dynamic,int>不采用'1'参数
在PostgreSqlMigrationSqlGenerator类中的以下方法给出了生成错误“代表System.Action不采取'1' 参数”:
private void GenerateStatements(IEnumerable<MigrationOperation> migrationOperations)
{
Check.NotNull(migrationOperations, "migrationOperations");
DetectHistoryRebuild(migrationOperations).Each<dynamic>(o => Generate(o)); // <=here!
}
/编辑扩展方法的签名如下:
/编辑2.下面是Generate
方法的声明:
private void Generate(HistoryOperation migration)
{
//migration
Check.NotNull(migration, "historyOperation");
using (var writer = Writer())
{
migration.CommandTrees.Each(
commandTree =>
{
switch (commandTree.CommandTreeKind)
{
case DbCommandTreeKind.Insert:
writer.Write(GetInsertHistorySql((DbInsertCommandTree)commandTree));
break;
}
});
Statement(writer);
}
}
我不知道为什么发生这种情况,因为Each
只有dynamic
类型,没有整数。但我对这种lambda表达式没有经验。要了解更多信息并让迁移工作,我希望有人能够解释为什么会发生错误以及如何修复。
@BradleyDotNET我把签名放在问题中。 – 2014-11-21 19:03:56
好的谢谢。那么我不明白为什么它会要求一个'int'。 – BradleyDotNET 2014-11-21 19:05:58
它似乎需要一个签名错误的扩展方法? – 2014-11-21 19:09:26