18 thoughts on “Table of Contents for DbContext Book

  1. Julie,

    I’m going to read both your DbContext and Code First book. Should I read the Code First book first, or does the order matter?

    Thanks,

    Jon

  2. I’ve heard people going back & forth! 🙂

    Code FIrst book will walk you through creating a project then learn about mapping. You should start there. But at some point you may think that you’re happy with the basics you’ve learned (first 6 chapters) then you might want to jump over to dbcontext book then back to cf for the deeper stuff. 🙂

  3. I’m picking up physical copies of both books today (have been reading Safari copies so far) and will follow your advice. Thanks for the quick response and for being so accessible.

  4. Julie, I’m puzzled by something on page 52 in the Code First book. Adding the decimal MilesFromNearestAirport in the class causes a "not null" column to be added to the database. I figured out how to add the .IsOptional() method in the configuration. Is there a way to create a decimal that allows nulls without the fluent API?

  5. Julie,

    For someone who has all 3 of your books and just getting started with EF, do you have a recommended reading sequence with notes on which chapters or parts from your original EF book are deprecated?

    Upon cursory viewing, it appears that the following order and sequence might apply:

    EF: 1-9

    CF: 1-6

    DB: 1-9 (full)

    CF: 7-8

    EF: 12-20 and 22 onwards

    Any thoughts or comments would be deeply appreciated.

  6. 1 question. In chaptor 3 (p. 61/62) the method ManualDetectChanges() shows 2 times modified:

    Before DetectChanges: Modified

    After DetectChanges: Modified

    and not Unchanged. why?

  7. But why? I have not changed the method and automaticdetectchanges is disabled:

    context.Configuration.AutoDetectChangesEnabled = false;

    Here is the VS2010 output when I set the breakpoint before context.ChangeTracker.DetectChanges();

    http://i.imgur.com/Y3kdg.png

    EF bug?

  8. I don’t believe so (RSS commetns) so I’ve just sent you an email (which I have access to in the admin mode of my blog) to test that I can indeed email you when I hear back from Rowan…just in case…

  9. In the Code First book, Mapping was covered but not deep enough. For example a 1-M relationship where there is more than one foreign key or composite foreign key resulting from that relationship.

    For example Photographers are assigned to 0-Many Events and Event are assigned to 0-Many Photographers. The associative table PhotographerAssignment thus has a composite PK. But It has a relationship (1-M) with AssignmentStatus resulting in a composite foreign key {PhotographerID (int) , EventNbr(a string). Nothing I have found, so far, addresses this very, very common thing in regards to mapping and fluent API syntax.

  10. Here it is: so simple now that I see it. But so much time wasted trying to find real world mapping examples.

    public PhotographerAssignmentConfiguration()

    : base()

    {

    HasKey(k => new { k.PhotographerID, k.LabOrderNbr });

    HasRequired(p => p.Photographer)

    .WithMany(a => a.Assignments)

    .HasForeignKey(f => f.PhotographerID);

    HasRequired(e => e.Event)

    .WithMany(a => a.Assignments)

    .HasForeignKey(f => f.LabOrderNbr);

    }

Leave a Reply

Your email address will not be published. Required fields are marked *