Skip to content

Commit

Permalink
Fix: hand crafted SQL vs parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwittke committed Feb 28, 2018
1 parent e14dde2 commit 37c8469
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public void EnsureIndex(DbContext dbContext)
string indexedColumnsSqlFragment = string.Join(", ", indexedColumnDefinitions);

dbContext.Database.ExecuteSqlCommand(
$"IF ((SELECT count(*) FROM sys.fulltext_catalogs WHERE name = '{FullTextCatalogName}') = 0) CREATE FULLTEXT CATALOG {FullTextCatalogName}");
$"IF ((SELECT count(*) FROM sys.fulltext_catalogs WHERE name = '{FullTextCatalogName}') = 0) CREATE FULLTEXT CATALOG " + FullTextCatalogName);

dbContext.Database.ExecuteSqlCommand(
$"IF ((SELECT count(*) FROM sys.fulltext_indexes i INNER JOIN sys.tables t ON t.object_id = i.object_id WHERE t.name = '{table}') = 0) " +
$" CREATE FULLTEXT INDEX ON [{schema}].[{table}] ({indexedColumnsSqlFragment}) KEY INDEX {primaryKeyIndexName} ON {FullTextCatalogName}");
" CREATE FULLTEXT INDEX ON ["+schema+"].["+table+"] ("+indexedColumnsSqlFragment+") KEY INDEX "+primaryKeyIndexName+" ON "+FullTextCatalogName);
}

private static string GetMemberName(Expression<Func<TAggregateRoot, object>> exp)
Expand Down

0 comments on commit 37c8469

Please sign in to comment.