Using Migrations with Effort.EF6?

.net c# effort entity-framework-6

Question

I'm using EF6 and I'm now setting up some tests for my aggregates. I've chosen to employ Effort. Because I don't want to have to install a whole database engine, I'd like for EF6 to run those tests.

My DbContext makes use of migrations and a data-inserting seeding technique. Should I utilize Effort's techniques of data seeding or can Effort.EF6 use that?

1
1
9/16/2015 12:02:00 PM

Popular Answer

The migrations happen on their own. When I require populated data, I invoke the standard context seed technique. Be aware that you might do a ton of queries to perform your seeding, depending on the breadth of your context (per test, or per test assembly). Since any seeding bugs will start showing up as bugs in your tests and any logging that occurs during seeding will log as part of each test, this has an impact on both performance and debugging.

var connection = Effort.DbConnectionFactory.CreateTransient();
var context = new DbContext(connection);
context.Seed();
2
7/30/2015 9:56:25 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow