Creating and Configuring Data Models from Your Classes

Take advantage of the Code First data modeling approach in ADO.NET Entity Framework, and learn how to build and configure a model based on existing classes in your business domain. With this concise book, you’ll work hands-on with examples to learn how Code First can create an in-memory model and database by default, and how you can exert more control over the model through further configuration.

Code First provides an alternative to the database first and model first approaches to the Entity Data Model. Learn the benefits of defining your model with code, whether you’re working with an existing database or building one from scratch. If you work with Visual Studio and understand database management basics, this book is for you.

  • Learn exactly what Code First does—and does not—enable you to do
  • Understand how property attributes, relationships, and database mappings are inferred from your classes by Code First
  • Use Data Annotations and the Fluent API to configure the Code First data model
  • Perform advanced techniques, such as controlling the database schema and overriding the default model caching

This book is a continuation of author Julia Lerman’s Programming Entity Framework, widely recognized as the leading book on the topic.

Julia Lerman

Julia Lerman is the leading independent authority on the Entity Framework and has been using and teaching the technology since its inception in 2006. She is well known in the .NET community as a Microsoft MVP, ASPInsider, and INETA Speaker. Julia is a frequent presenter at technical conferences around the world and writes articles for many well-known technical publications including the Data Points column in MSDN Magazine.

Julia lives in Vermont with her husband, Rich, and gigantic dog, Sampson, where she runs the Vermont.NET User Group. You can read her blog at and follow her on Twitter at julielerman.

Rowan Miller

Rowan Miller is based in Seattle, Washington and works as a Program Manager for the ADO.Net Entity Framework team at Microsoft. Prior to moving to the US he resided in the small state of Tasmania in Australia. Rowan speaks at technical conferences and blogs at Outside of technology Rowan's passions include snowboarding, mountain biking, horse riding, rock climbing and pretty much anything else that involves being active. The primary focus of his life, however, is to follow Jesus.