I am trying to build the PostgreSqlGeneration
code from this repository on Mono. Unfortunately I get an error I do not understand.
In the PostgreSqlMigrationSqlGenerator class the following method gives the build error "delegate System.Action does not take `1' arguments":
private void GenerateStatements(IEnumerable<MigrationOperation> migrationOperations)
{
Check.NotNull(migrationOperations, "migrationOperations");
DetectHistoryRebuild(migrationOperations).Each<dynamic>(o => Generate(o)); // <=here!
}
/edit The signature of the extension method is as follows:
/edit 2. Here is the declaration for Generate
method:
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);
}
}
I do not know why that happens since the Each
only has a dynamic
type and no integer one. But I am not that experienced with such lambda expressions. To learn more and to get the migrations to work I hope someone can explain why the error happens and how it can be fixed.