Why don't we have Context.Models.Clear() RRS feed

  • Question

  • I'm using CodeFirst "EF 4.1 Update 1" with Migration. 

    The problem that I have is that I'm adding some pre-defined data in Seed() of Setting and those data keep on adding whenever I run "update-database". So, I'm thinking to clear the data before adding those pre-defined data. But I found that there is no Clear() method. 

    What would be the best way to clear the data? Do we really have to use either the inline sql or call Remove in the loop? 

    Michael Sync: blog: http://michaelsync.net
    Friday, September 30, 2011 3:08 AM


All replies