Code First/Entity Framework 4.1 Videos and Articles on MSDN

Currently, 8 of the 10 videos on Code First and EF 4.1 I have already created for MSDN are online but they are not easy to find.

Three of them are on the msdn.com/data/videos page. The others have not been placed there yet although you can find links to the videos at msdn.com/data/ef and then from the videos to the articles.

Here are direct links to all of the videos and related articles that are currently online.

  1. Building an MVC 3 App with Code First and Entity Framework 4.1  Whitepaper     Video
  2. Building an MVC 3 App with Model First and Entity Framework 4.1 Whitepaper    Video
  3. Building an MVC 3 App with Database First and Entity Framework 4.1   Whitepaper    Video
  4. Code First Data Annotation   video     article
  5. Code First Relationship Fluent API  video   article not online yet
  6. Code First Database Initializers      video   article not online yet
  7. Validation in Code First and DbContext:  video   article  (note 4/15: MSDN's EF page points to the annotations content, but I found the correct links :) )
  8. Code First: Mapping Fluent API:  video   article not online yet
  9. DBContext Change Tracker API: video & article not online yet
  10. Code First and WCF Data Services: video & article not online yet

Samples?

I have provided C# and VB samples to go with each section. The samples are already online for the first three and are available from the pages with the articles, not the videos.

Monday May 2, 2011: There seems to be a problem with the videos on MSDN's website. I have contacted MSDN. They are aware of the problem and trying to resolve it. Sorry. I just created the videos and have nothing to do with the hosting. ;) Will modify this blog post when the problem has been resolved.  All better now! (8pm EST May 2)

Shout it
#1 Khai on 4.16.2011 at 10:53 PM

Hi Julie,

Great tutorials. Will these videos be posted on PluralSight? thanks

#2 Julie on 4.17.2011 at 12:17 PM

thanks. No these were for MSDN. I'll do longer more indepth ones for Pluralsight though!

#3 Joe on 4.18.2011 at 2:03 AM

Hi Julie - loved your EF videos on Pluralsight, and looking forward to the 4.1 PS "more indepth" videos.

I noticed dbcontext doesnt support calling sprocs for CRUD operations? Is there a workaround of some kind? I went looking for a OnInsert/Update/Delete etc, but didnt see any way to hook it.

Am I out of luck with dbcontext?

#4 Julie on 4.18.2011 at 2:18 AM

yes and no (out of luck). You can always get to the ObjectContext from the DbContext. In fact I have an idea for a blog post :)

#5 Julie on 4.18.2011 at 2:52 AM

@Joe: Here's the blog post for you! thedatafarm.com/.../accessing-objec

#6 Julie on 4.18.2011 at 3:55 AM

@Joe - wanted to point out two things: 1) there is no direct sproc support like the mappoings to override insert/update/delete when you call savechanges. what I didn't realize is that dbContext does have some database methods via dbContext.Database. See Rene's comment in the other referenced blog post

#7 Joe on 4.18.2011 at 10:36 PM

That is what I was afraid of -> no way with dbcontext like with ObjectContext savechanges to tell EF "when you want to insert/update/delete use this sproc". This is a bummer :-(

What Im trying to do is to use EF as my DAL, and then have DAL independent (read: no DB access code bloat) classes that can be used both on the server and in a client side silverlight app. This is what drove me to the code first EF stuff.

But I also need to have sproc usage for the purposes of auditing data changes to the entities in the DB (ie, the sprocs log data changes-> who, when, what etc).

I want cake and eat too :-)

#8 Joe on 4.20.2011 at 9:30 PM

Does this make sense? ->

I do a database first EF impl with ObjectContext for my DAL. I do a completely independent (ie, no EF code) set of classes for the rest of the application. And I have some simple converters between them (wont be much code, its just field copies).

Make sense, or am I overthinking this?

#9 Julie on 4.20.2011 at 10:25 PM

@joe...perfectly good. Ef simply as a DSL is a great way to leverage ef. Its flexible to fit in a lot if architectures...from drag n drop to something like yours.

#10 Bill on 4.24.2011 at 12:58 AM

Julie:

Regarding code first and data annotation: how do I define a property so that it maps back to a Text data type in the database?

Thanks. Great videos and great book.

#11 Camey on 4.25.2011 at 12:18 PM

Great list! I've been given a Pluralsight subscription as a user group leader perk, and I'm looking forward to checking out your videos.

#12 mikeyrad on 4.25.2011 at 3:41 PM

Just viewed the Building an MVC 3 App with Database First and Entity Framework 4.1. How would I go about adding data annotation attributes (e.g. [Required]?) Or am I better off using EF code first and then mapping to my database?

#13 Simone on 4.25.2011 at 3:59 PM

Great work on the Database First, I'm new to EF and that video got me hooked!

#14 Julie on 4.30.2011 at 4:17 PM

Sorry I've been away. :)

@mikeyrad: There's a way to add annotations to a partial class but it's so klugdy it's called "ugly buddy classes". Examples here: msdn.microsoft.com/.../cc488527.aspx

@Bill: You can specify a db data type in the Column attribute. If you need to see how EF types map to DB types, check out this blog post: http://juliel.me/jNMbgo

@Camey and Simone: <grin>

#15 Richard Thomas on 5.01.2011 at 9:18 AM

Hi Julie, none of the videos seems to working. I tried in Chrome, IE9, and FF4. :( Thanks!

#16 Julie on 5.01.2011 at 9:36 AM

@Richard

I've heard a few people having problems with the videos and then suddenly they were working again.

FWIW, I jsut spot checked a fw in chrome and ie9 and am also having problems. The silverlight loader spins at 0%, then goes away and leaves me with a static image but no controls to play/pause etc. Assuming it will resolve itself, just like it broke itself, but I did forward the info to one of the MSDN online folks. (who is hopefully sleeping as it's Sunday 6:30am his time right now :))

#17 Linda Claire Robinson on 5.02.2011 at 4:08 PM

the video for database first is not working. Also, Where Can I download the db as this is a db first approach.

#18 Julie on 5.02.2011 at 4:20 PM

@Linda, the db is in the sample downloads. The samples seem to be attached to the whitepaper not to the video. So go to the page for the db first article and you'll see the downloads.

#19 Julie on 5.02.2011 at 4:22 PM

@Linda & @Richard,

MSDN is aware of the problem and working on a fix. Sorry for the trouble.

#20 Julie on 5.02.2011 at 8:12 PM

The server has been kicked and the videos can be viewed again. Enjoy!

#21 Ady on 5.05.2011 at 7:29 AM

Any idea when the "10.Code First and WCF Data Services" article will be online. I am particularly interested in how this will pan out.

#22 Julie on 5.05.2011 at 8:41 AM

@Ady...wish I knew. FWIW, it's stupid simple. Just a quick 5 minute video so you can see that yes, they do work together. It's not an architected app. Console app used to demo consuming the service. I'll ask.

#23 Omu on 5.25.2011 at 4:28 AM

there's a EF4.1 sample here: http://prodinner.codeplex.com

#24 william simons on 6.12.2011 at 9:21 PM

julie,

Do you remember that I asked you about silverlight and wcf ria. It turns out, wcf ria does not support

ef code first. Jeremy likness did a great tutorial on silverlight 3 and code firsthttp://forums.silverlight.net/forums/t/231467.aspx

#25 william simons on 6.21.2011 at 2:15 PM

It looks like code first will not be avaiable till silverlight 5...

#26 Julie on 6.21.2011 at 2:21 PM

Hi william, code first RTMd a few months ago! Maybe you mean the code first support for RIA Services? :)

#27 william simons on 7.02.2011 at 4:17 PM

Dear julie,

You are right that is what I meant

The wcf ria team just released support for code first 4.1. Jeff handley jeffhandley.com/.../RIAServicesCode

I am overjoyed at this news, silverlight, mvvm, code first, microsoft prism at least in my opinion are the way to go when you are talking about n-tier, class libraries,resource dictionaries etc.

#28 Saeed on 9.01.2011 at 3:33 AM

Dear Julie,

I hope i could download EF 4.1 Videos. Any way thank you for all your works.

#29 Mark Phillips on 9.10.2011 at 2:44 PM

Thank you Julie.

You do excellent work

#30 Simon Stewart on 9.22.2011 at 7:54 AM

Thanks, just a pity the videos aren't downloadable.

Streaming sucks in the 3rd world. :-(

Leave a Comment