Sunday, May 26, 2013

Edward Farley and the Fantastic Library - A 12 part tale of the Entity Framework Code First

Entity Framework 5 Code First Relationships

Preface

When I started this series about Entity Framework, I needed a good metaphor for the database relationships. I decided on a library, but soon realized my examples were becoming contrived. I was "fitting facts to suit theories."* And yet I liked the library story.

Imagination floated in--as she often does--and in that kind yet firm tone said, "Why constrain yourself to reality? Why not invent?"

I listened, and after assembling all the material, wrote the light story of of a boy, Edward Farley, and his desire to learn. Following Netflix's example with House of Cards, I'm releasing all the parts at once.

What follows is an opinionated (in the positive sense) set of examples for creating EF 5 Code First Relationships. It's for me, the way I like to do them, and if it helps you, wonderful.

There are some oblique database references, and more than a few links to people and things that interest me. I've tried hard to be error-free, but that is a path of folly.