Switching from ObjectContext to DbContext in your Entity Framework EDMX File

Tres easy and much cleaner classes turfed out the other end;


  1. #1 by Gareth on March 22, 2012 - 11:01

    Code first is alot easier to maintain that the wizard. Definitely when you want to extend the model. Remember though if you change your model (adding new fields), you will need to drop and re-create the DB to include the code to seed your existing data.

    Also the TDD for seeding and testing your models is nice…….

  2. #2 by Shawson on May 1, 2012 - 22:04

    Code-first is dirty! This is db first, but using the DbCOntext as the context (normally native to code first) as opposed to the default ObjectContext. To update your model you go to the edmx, right click the design surface and say update model! What could be simpler?! But on the flip side, because I’m using DbContext with the t4 templates, I have access to how the classes get generated and can easily inspect them (and the context object itself). Very nice way of working.

(will not be published)

I absolutely love these. They came at the lace wigs are good quality, and very soft. Absolutely love these extensions. I just love this hair. Hair came on time, I waited until after hair extensions uk very full, no shedding and it is been installed for 3 weeks now and yes I jus ordered 3 more bundles. Lol. I definitely recommend this company for your bundles ladies. They are soft, hair bundles on the head for human hair wigs and I would continue to recommend them. I have thinner hair so they cover and blend nicely.