# 7 - (re)Creating your DB with Linq's DataContext for testing


6/3/2008
Level: Intermediate
Tags: Linq2Sql
Comments: (1)
Author:
Derik Whittaker


In this episode we will learn how to use the DataContext object that is part of Linq2Sql to build/rebuild our data base for testing.

We will walk though the creation of the database, the creation of data and learn how to wire this process up to our Tests.
Click here to Watch this Episode

Download (13.28 MB) (10:58) (1440x900)
Download (9.62 MB) (10:58) (960x600)

Links/Resources:


Images/Screen Shots:


DB Creation Logic


Test Fixture Logic


Insert Test data logic


Comments: (1)

Damien Guard said....
I think he was asking how stored procedures are handled within CreateDatabase rather than how to use them from code. None of the stored procedures are re-created by CreateDatabase neither are tables not used by the datacontext and obviously not the data held within them. DeleteDatabase and CreateDatabase are limited and should be considered carefully before use. [)amien

6/6/2008 11:31:19 AM


Name: *
Email (not displayed): *
Url:
Comments: *



Submit this story to DotNetKicks