KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying out Entity Framework Code First. I can't seem to find the assembly/namespace to use for RecreateDatabaseIfModelChanges in WPF 4.0. Is this an ASP.NET-only feature? If not, what assembly should I reference? Here's my code: using System; using System.Data.Entity; using System.Windows; using CodeFirstTester.Models; namespace CodeFirstTester { public partial class App : Application { static App() { // this fails: Database.SetInitializer(new RecreateDatabaseIfModelChanges<NerdDinners>()); // The type or namespace name 'RecreateDatabaseIfModelChanges' // could not be found (are you missing a using directive or // an assembly reference?) using (var nerdDinners = new NerdDinners()) { var dinner = new Dinner() { Title = "Party at Scott's House", EventDate = DateTime.Parse("12/31/2010"), Address = "Building 40", HostedBy = "scottgu@microsoft.com" }; nerdDinners.Dinners.Add(dinner); nerdDinners.SaveChanges(); } } } }
Tags (comma-separated)
Save Edits
Cancel