Skip to content

Commit

Permalink
Add exception message, highlighting to user they have not specified t…
Browse files Browse the repository at this point in the history
…ablename
  • Loading branch information
hunt3ri committed Jul 26, 2012
1 parent 5969210 commit aa8c5b9
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -212,6 +212,9 @@ public virtual string GenerateForeignKeyName(CreateForeignKeyExpression expressi

public override string Generate(DeleteForeignKeyExpression expression)
{
if (expression.ForeignKey.ForeignTable == null)
throw new ArgumentNullException("Table name not specified, ensure you have appended the OnTable extension. Format should be Delete.ForeignKey(KeyName).OnTable(TableName)");

return string.Format(DeleteConstraint, Quoter.QuoteTableName(expression.ForeignKey.ForeignTable), Quoter.QuoteColumnName(expression.ForeignKey.Name));
}

Expand Down

0 comments on commit aa8c5b9

Please sign in to comment.