Closed antonlq closed 4 years ago
Hello @antonlq ,
In the second case, you try to create the index via SQL Syntax.
However, Effort
is not a real SQL database. So it's probably skipped and nothing is created.
Best Regards,
Jon
Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework Extensions • Entity Framework Classic • Bulk Operations • Dapper Plus
Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function • SQL Eval Function
Hello, I don't really know if this is just a question or an issue so I'm sorry if this is posted in the wrong place.
We have issues with our unit testing. We use Entity Framework and have some migration scripts that have added some Unique Indices in our database which are working fine. But when we're using Effort and testing against the in memory database we get mixed results.
First I'm going to show you code from a migration script where the Unique Index is working correctly in our unit testing:
CreateIndex("dbo.Table", "Number", unique: true, name: "IX_Number");
And here is code where the Unique Index is not working when testing against the in memory database:
this.Sql("CREATE UNIQUE NONCLUSTERED INDEX IX_Id_NotNull ON [dbo].[Table](TestId) WHERE TestId IS NOT NULL");
In the latter scenario we don't get an Unique Key Violation exception if we are inserting some TestId that already exists.
Is there any issue regarding in memory database with creating an Unique Index the way it's done in the latter case?
Best regards