public void CreateIndexBuilder_SqlServer_Unique_CreatesUniqueNonClusteredIndex()
 {
     SqlSyntaxContext.SqlSyntaxProvider = SqlServerSyntax.Provider;
     var createExpression = new CreateIndexExpression { Index = { Name = "IX_A" } };
     var builder = new CreateIndexBuilder(createExpression);
     builder.OnTable("TheTable").OnColumn("A").Ascending().WithOptions().Unique();
     Assert.AreEqual("CREATE UNIQUE NONCLUSTERED INDEX [IX_A] ON [TheTable] ([A])", createExpression.ToString());
 }
Esempio n. 2
0
 public ICreateIndexForTableSyntax Index(string indexName)
 {
     var expression = new CreateIndexExpression { Index = { Name = indexName } };
     _context.Expressions.Add(expression);
     return new CreateIndexBuilder(expression);
 }
Esempio n. 3
0
 public ICreateIndexForTableSyntax Index()
 {
     var expression = new CreateIndexExpression();
     _context.Expressions.Add(expression);
     return new CreateIndexBuilder(expression);
 }