Entity Framework 6 Record and play use : Making demos ( part 3 of 5)

 

Part 1 : What is EF record and play : http://msprogrammer.serviciipeweb.ro/2014/11/29/entity-framework-6-record-and-play-1-of-5/ 

Part 2: EF Record and play use: Testing : http://msprogrammer.serviciipeweb.ro/2014/12/08/entity-framework-6-record-and-play-use-unit-testing-part-2-of-5/

Part 3: EF Record and play use: Make demo: http://msprogrammer.serviciipeweb.ro/2014/12/14/entity-framework-6-record-and-play-use-making-demos-part-3-of-5/ 

Part 4: EF Record and play use: Record user Sql when a bug occurs: http://msprogrammer.serviciipeweb.ro/2014/12/26/ef-record-and-play-use-recording-user-sql-when-a-bug-occurred-part-4-of-5/

Part 5: EF record and play: conclusions: http://msprogrammer.serviciipeweb.ro/2015/01/05/ef-record-and-play-conclusions/

 

 

Let’s assume you want to register a demo for a application ( Desktop or Web).

You do arrange the database and you make some repetition before. However, the database must be re-arranged the next time you will make the demo.

For this case you can use EF 6 Record and play – it will make a .zip file with containing resultsets and you can make indefinitely the repetition of the demo – without the real database.

 

Let’s see in action here

 

 

The code is simple

 Database.SetInitializer<ContextForDatabase>(null);
            #region set record EF
            record = new InterceptionRecordOrPlay(@"DemoEmployeeAndDepartment.zip", ModeInterception.Play);

            DbInterception.Add(record);
            #endregion

Source code is available at  https://github.com/ignatandrei/EFRecordAndPlay/wiki/

There is also a NuGet package at https://www.nuget.org/packages/EFRecordAndPlay/