Coolthing Of Theday

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, 24 May 2013

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

Posted on 06:54 by Unknown

Software Meadows - Edward Farley and the Fantastic Library Part 1

1) Preface
2) Introduction
3) A Simple Table
4) One to One or Many
5) Zero or One to Zero or Many
6) One to Zero or Many
7) One to Zero or One
8) One to One
9) Many to Many, Simple
10) Many to Many with Payload
11) Enumerables
12) Inheritance

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.

...

Edward Farley and the Fantastic Library Part 2

Introduction

Where Edward Farley begins his quest.

When Edward Farley turned twelve years old, he announced to his family, “I’m going to the library and find out how everything works.”

You might imagine that his parents would be surprised, or puzzled. But Edward had always been like this, wondering the how and why of things. In fact, his mother and father expected a day like this.

“Well, Edward, if you really want to know, then there’s only one person to ask,” said his father.

“Who?”

“Professor Relvar.”

Edward nodded. “Which reading room is he in?”

...

Edward Farley and the Fantastic Library Part 3

A Simple Table

Professor Relvar lays the framework for learning the Framework.

First, Edward [said the Professor], we’re going to write some code that will make it easier to learn about the Framework. And we’ll always strive to be a simple as possible--but not simpler.* You’re familiar with Visual Studio, I assume? Good. We’ll create a Console Application and name it something whimsical. How about “GnomeMobile”? No? Well, then, we’ll name it “LearningEF.” Next, we’ll add the Entity Framework 5 NuGet package. We’ll use SQL Express, so that we can easily run queries using Enterprise Manager. Are you following? Good. Normally, I like a file per class, but today I feel abnormal, so we’ll put the entire schema in one file. Here is the class for our first table.

...

A very cool and interesting way to get an introduction to EF CF. Heck, you might want to read this just for the fun of reading it... :)

(via The Morning Brew - The Morning Brew #1363)

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in .Net, Development, EntityFramework | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Mr. 7,000! This is my 7,000th post...
    Before this post; After; 20 visits between taking these snaps? Oh wait, that's probably me searching for past related posts....
  • "Windows Server Essentials Media Pack" (DNLA Stream, HTML5 and Dashboard Media stuff)
    Microsoft Downloads - Windows Server Essentials Media Pack This pack enables the media streaming functionality for Windows Server 2012...
  • Rad Gate Post... Get your Red Gate Post here...
    simple talk - Melanie Townsend - Get a copy of the Red Gate Post We recently put together a newspaper of some of the best articles fr...
  • Windows Management Framework 4.0 (PowerShell 4, PowerShell ISE, Management OData, WMI, etc.) now available
    Keith Hill's Blog - PowerShell 4.0 Now Available You can get PowerShell 4.0 for down level operating systems now via the WMF 4.0 d...
  • Viasfora - Your new favorite Visual Studio Text/*ML Editing Extension?
    Winterdom - Introducing Viasfora A couple of days ago, I unveiled Viasfora , my latest attempt at building a decently packaged extensi...
  • "Windows Server [2012 R2]: The Best Infrastructure to Run Linux Workloads"
    In the Cloud - What’s New in 2012 R2: Enabling Open Source Software Part 4 of a 9-part series . ... There are a lot of great s...
  • [Hardware Review] Life with Haswell... Haswell/Harris Beach Intel SDS Ultrabook Review - Part 2
    "So Greg, how's life with Haswell been?" "Pretty Sweet! (Mostly)" I've been given an opportunity to review t...
  • Fuzzy Lookup Add-In for Excel (Insert lame "Fuzzy, wuzzy was an Excel..." snip here)
    Microsoft Downloads - Fuzzy Lookup Add-In for Excel The Fuzzy Lookup Add-In for Excel performs fuzzy matching of textual data in Exce...
  • Caliburn.Micro v1.5.0 released (CM gets Tasks, Async/Await and Share/Setting for RT... and bug fixes of course)
    Caliburn.Micro - Caliburn.Micro v1.5.0 "Release Notes This release fixes many bugs. It also adds support for Task and async/a...
  • Just about everything you ever wanted to know about SQL Server Date and Time Data Types...
    CodeProject - Date and Time Data Types and Functions - SQL Server (2000, 2005, 2008, 2008 R2, 2012) Introduction It would be bette...

Categories

  • .Net
  • 3DPrinting
  • AFeedYouShouldRead
  • Agile
  • ALM
  • Amazon
  • Amiga
  • Analytics
  • Android
  • ASP.NET
  • Azure
  • BigData
  • bing
  • Blogging
  • Book
  • BookReview
  • BUILD
  • C
  • C#
  • C++
  • Career
  • Cat
  • cheatsheet
  • ClickOnce
  • Cloud
  • ComputerHardware
  • css
  • Data
  • DBA
  • DependencyInjection
  • Deployment
  • Design
  • Development
  • devops
  • DVCS
  • ebook
  • EDD
  • Education
  • EnterpriseLibrary
  • EntityFramework
  • Exchange
  • Expression
  • gadget
  • Game
  • GIT
  • Google
  • Government
  • Hadoop
  • hardware
  • HardwareReview
  • HaswellReview
  • HTML5
  • Humor
  • IE
  • IEExtension
  • IfAllElseFails
  • IIS
  • ILMerge
  • Image
  • Infographic
  • interview
  • InversionOfControl
  • Java
  • Javascript
  • Kinect
  • LightSwitch
  • LINQ
  • Linux
  • LosAngeles
  • Lucene
  • Lync
  • MEF
  • Metro
  • MicrosoftOffice
  • MicrosoftOutlook
  • Mono
  • MVC
  • MVVM
  • NetMon
  • NLP
  • NoSQL
  • NuGet
  • OData
  • OneNote
  • OpenXML
  • Paint.Net
  • Personal
  • Photosynth
  • Physics
  • portable
  • Poster
  • PowerShell
  • Preparedness
  • Presentation
  • Prism
  • PrivateCloud
  • RegEx
  • RemoteDesktop
  • Reporting
  • RIAServices
  • Science
  • ScienceFiction
  • Scratch
  • Scrum
  • ServiceBus
  • SharePoint
  • Silverlight
  • SimiValley
  • SPA
  • Space
  • SQLServer
  • Storyboard
  • Surface
  • SVG
  • SystemAdministration
  • T4
  • TeamBuild
  • TeamFoundationServer
  • TechEd
  • Training
  • TypeScript
  • UnitTesting
  • UnityApplicationBlock
  • Utility
  • Veteran
  • VirtualMachine
  • Visio
  • VisualBasic
  • VisualStudio
  • WCF
  • Web X.X
  • Webcast
  • WebFeed
  • WebMatrix
  • Windows
  • Windows7
  • Windows8
  • Windows8.1
  • WindowsHomeServer
  • WindowsLiveWriter
  • WindowsPhone
  • WindowsServer
  • WinRT
  • WiX
  • WMI
  • WOPI
  • WPF
  • XAML
  • XBox360
  • XboxOne
  • zombie

Blog Archive

  • ▼  2013 (500)
    • ►  December (12)
    • ►  November (61)
    • ►  October (65)
    • ►  September (38)
    • ►  August (47)
    • ►  July (75)
    • ►  June (39)
    • ▼  May (40)
      • Brian (and Infragistics) is having a theme give-aw...
      • MarraLAB for Visual Studio, your new DDE (Debuggin...
      • TechEd Reveal - Looks like BizTalk ain't dead yet....
      • From A to W... The US Gov goes Git (and API crazy ...
      • Windows 8.1 Pre-beta WinRT API Spelunking (Think, ...
      • Edward Farley and the Fantastic Library - A 12 par...
      • SQL Server Database Project SqlBuildTask failing a...
      • Your plate will never be full with all the great G...
      • Go long and thanks for the 1's, 2's and 3's... Lot...
      • Many events, lots of devices, one you and your new...
      • Extended WPF Toolkit gets all v2.0 and now include...
      • Cool Kid Training from Pluralsight, that's free to...
      • Visual Studio ALM Ranger Solutions Catalog - All A...
      • Just the SSMS Mama, just the SSMS... (Getting just...
      • "The database is slow!" Here's a SQL Server Perfor...
      • A little heritage of the BSOD
      • "Hello dotPeek plugin" Creating a dotPeek plugin i...
      • Okay, Okra! Windows Store Templates that make MVVM...
      • GBoD [Geo-distributed Bunch of Data centers] or "U...
      • More on Mission Control (Coding4Fun Style) "A Flex...
      • Because every IDE needs a fart-app, right? Farticu...
      • The NSA Untangles the Web - 651 Pages of NSA Web S...
      • Who needs an App Store when we now have a DevStore...
      • Mission Control to Major...C4F - Coding4Fun Missio...
      • And Data for All... President Obama signs Executi...
      • C#'ing Objective C with Xamarin's new Objective Sh...
      • More Metro... Syncfusion Metro Studio 2 released. ...
      • Visualizing TFS Source History now with more source
      • Go can be more than just a GO (in the T-SQL world ...
      • Prep'ing your Pets, National Animal Disaster Prepa...
      • Sometimes you just need a donut [chart]... Free Mo...
      • And it does Windows too... Using Process Monitor t...
      • Free'ish [reg-ware] Windows 8 QRC (Quick Reference...
      • TFS Web Licensing for Greg's (i.e. dumm... well yo...
      • PII Problems in the Public Enron Data Set (aka "In...
      • WebMatix Gets Azure, Version Control Support, Remo...
      • So long and thanks for all the ghosting... Ghost i...
      • 13 Modules, six weeks, 2 exam preps and a whole lo...
      • Git 101 - Beginners guide to groking [command line...
      • Surface Pro Driver Pack now available
    • ►  April (42)
    • ►  March (39)
    • ►  February (42)
Powered by Blogger.

About Me

Unknown
View my complete profile