Monthly Archives: April 2010

Bio and Photos

Bio and Pictures as of April 2012

For Conferences, User Groups, etc.

[Longer Bio: 158 words, 1021 chars including spaces] 

Julie Lerman is the leading independent authority on Microsoft’s ADO.NET  Entity Framework and has been using and teaching the technology since its inception in 2006. Julie is the author of the highly acclaimed "Programming Entity Framework” book series from O’Reilly Media with recent editions on Code First (Dec 2011) and DbContext (Feb 2012) . She is well known in the .NET community as a Microsoft MVP, ASPInsider and INETA Speaker. She is a prolific blogger and a frequent presenter at technical conferences large and small around the world, such as TechEd and DevConnections. She also writes articles for many well-known technical publications, including the monthly Data Points column in MSDN Magazine. Julie keeps busy creating training videos for MSDN and Pluralsight.com.

Julia lives in Vermont where she has run the Vermont.NET User Group since 2002 and was a founding board member of the Vermont Software Developers Alliance. You can read her blog at www.thedatafarm.com/blog and her tweets at twitter.com/julielerman.

[Shorter Bio: 70 words, 454 chars including spaces]

Julie Lerman is a Microsoft MVP, .NET mentor and consultant who lives in the hills of Vermont. You can find Julie presenting on Entity Framework and other Microsoft .NET topics at user groups and conferences around the world. Julie blogs at thedatafarm.com/blog, is the author of the highly acclaimed "Programming Entity Framework” books, the MSDN Magazine Data Points column and popular videos on Pluralsight.com. Follow Julie on twitter at julielerman.

julie_100x130.jpg juliex400.jpg JulieLermanGeekette.jpg
julie_100x130 juliex400 JulieLermanGeekette
100w x 130h, 7kb 400w x 442h, 32kb 110w x 127h, 5kb

 

 I have larger, hi-res versions as well. Email me if you want them.

Late Spring Snow Storm

Yesterday morning it started snowing and didn’t stop until about 3pm this afternoon. Heavy wet spring snow that accumulated to about a foot where we live. Luckily we didn’t lose any trees but the power’s been out for quite some time.

Here are some pics from the crazy storm.

From the road. See those shrubs in front of the fence? I had just unburied them.

IMG_3408

3 hours later, those same shrubs. They are okay now.

IMG_3407

Our magnificent, gigantic pines

IMG_3405

Sampson and his pal Sadie

IMG_3415

After the storm

IMG_3419

News about Programming Entity Framework 2nd Edition

Programming Entity Framework 2nd Edition (based on the RTM of VS2010/.NET 4.0) is currently available on Safari Rough Cuts at http://oreilly.com/catalog/9780596807252. At this point most of the chapters are there. You’ll find 2-23. Note that chapter 4 will be broken into 4 and 5 in the final edition. I changed the chapter numbering after chapter 16 to accommodate this which is why there is no chapter 17. Chapters 24 is about n-Tier CLient applications using an WPF example and chapter 25 is about n-Tier web apps with ASP.NET MVC and ASP.NET WebForms examples both using the repository built in Chapter 22. Chapter 1 will be introductory as it was in the first edition and Chapter 26 will wrap up some loose ends.

The book is now going through copy editing and technical editing so if you read the rough cuts and find a comma missing, don’t worry about it. If you happen to find something really wrong…a coding boo-boo or a misused term (I’m famous for switching inherits and implements) leave a note in the online feedback form on O’Reilly’s site so we can be sure to correct it before the final cut.

This is a complete rewrite of the book and includes not only the new features of Entity Framework, but chapters on unit testing, building repositories and even using Entity Framework in ASP.NET MVC applications. I’ve been working extra hard to be sure the book is current, not just a copy of the first edition.

We’re hoping to have the book in print by mid-July.

You can subscribe to the Rough Cuts, pre-order the final edition on O’Reilly or on Amazon. There will also be a variety of digital versions of the final book

Querying Literals in Entity SQL

Entity SQL might surprise you if you are building query expressions with some non-string types.

I’ve blogged about this before with the DateTime literal after trying to use a string to represent the date in my query as I’m used to with TSQL. Here is a snip from that post:

SELECT VALUE BAModel.Contact(c.ContactID,c.FirstName,c.LastName,c.Title,c.AddDate,c.ModifiedDate)
FROM dbo.Contact as c
WHERE c.AddDate>="1/1/2007"

I was trying to emulate T-SQL here but I need a date, not a string. I thought that without a function I was hosed again, until I discovered Entity SQL’s Literals and rewrote the query successfully this way.

SELECT VALUE BAModel.Contact(c.ContactID,c.FirstName,c.LastName,c.Title,c.AddDate,c.ModifiedDate)
FROM dbo.Contact as c
WHERE c.AddDate>= DATETIME’2007-01-1 00:00′

I’ve had  number of emails recently with people using Entity SQL and having problems similar to this, most commonly with decimals & doubles (e.g., 123.24). First I will point you to the MSDN documentation page on Literals for Entity SQL.

The clues to expressing the queries are in this doc, however they are REALLY easy to miss.

Let me highlight a few of these with some emphasis on the specific clues:

Integer

Integer literals can be of type Int32 or Int64. An Int32 literal is a series of numeric characters. An Int64 literal is series of numeric characters followed by an uppercase L.

Decimal

A fixed-point number (decimal) is a series of numeric characters, a dot (.) and another series of numeric characters followed by an uppercase "M".

Float, Double

A double-precision floating point number is a series of numeric characters, a dot (.) and another series of numeric characters possibly followed by an exponent. A single-precisions floating point number (or float) is a double-precision floating point number syntax followed by the lowercase f.

Notice those “followed by” notes now? 🙂

So, this ESQL expression will fail:

select p.amount from BAEntities.Payments as p where p.amount=125.25

The exception message is “The argument types ‘Edm.Decimal’ and ‘Edm.Double’ are incompatible for this operation. Near WHERE predicate, line 1, column 61.

The correct way to express this query is to be sure the decimal is followed by an uppercase "M".

select p.amount from BAEntities.Payments as p where p.amount=125.25M

That query works like a charm.

Pictures from VTdotNET VS2010 Launch

Vermont.NET’s April meeting coincided with the Visual Studio 2010 launch so we had our own launch event!

With cake…

IMG_3373

It was our biggest meeting attendance ever with 60 signed up and 56 signed in at the door.

Four people presented…”some of our favorite things about VS2010 and .NET 4.0”. The presenters were Victor Castro, Eric Hall, Rob Hale and myself.

IMG_3374

IMG_3375

Instead of the usual pizza, we had a feast of sandwiches, rollups, chips and veggies & dip, all very generously provided by Green Mountain Coffee Roasters. Not just paid for but ordered, picked up and delivered by our favorite GMCR gal, Marlena Farnham. This was one of the things that made the meeting special.

IMG_3378

IMG_3376

IMG_3377

Eric Hall got the primo slice of cake!

IMG_3379

I started the Vermont.NET group in February of 2002. We’ve been meeting monthly for over 8 years. That’s nearly 100 meetings. And I have to say this was the best one ever!  I just love the Vermont.NET community.

Some post-VS2010 Launch Resources

Here are some useful links related to the Vermont .NET VS2010 launch meeting on Monday night with our RECORD Breaking attendance! 🙂

MSDN Visual Studio Developer Center: msdn.microsoft.com/vstudio

VS2010 Comparison of various SKUs: http://www.microsoft.com/visualstudio/en-us/products

VS2010 Trial Downloads: http://www.microsoft.com/visualstudio/en-us/download

Great links from MicrosoftFeed.Com

Moving to Visual Studio 2010 e-book from Microsoft: http://www.microsoft.com/downloads/details.aspx?familyid=12A6DE81-C633-4F2C-A35F-CEA6FE772712&displaylang=en

What’s new in VS2010 Video (thanks Paul Harriman for this link)  http://msdn.microsoft.com/en-us/vstudio/ee958386.aspx

What’s new in .NET 4 (MSDN Docs): http://msdn.microsoft.com/en-us/library/ms171868(v=VS.100).aspx

What’s new in VS2010 (languages, IDE, Editor, etc) (MSDN Docs)  http://msdn.microsoft.com/en-us/library/bb386063(v=VS.100).aspx
 
 

Visual Studio 2010 Launch Keynote and other cool stuff from the launch: http://www.microsoft.com/visualstudio/en-us/watch-it-live

Note that if you watch the keynote video, the first 1/2 is interviews and more, but there’s a marker pointing to where the keynote starts.keynote

VS2010 Trial and MSDN Subscribers – Trial Conversion Keys Now Available

If you downloaded the VS2010 Trial and need to unlock it with your MSDN key, you’ve probably been scratching your head the past few days because the VS2010 downloads on MSDN are “prepidded” (PID is Product ID). The keys are built in. The solution was to download the MSDN version and start up the install which would then apply the key to the already installed trial. Well, many of us know that MSDN has been a little slow and then completely crapping out since VS2010 was released on Monday. And if you’re like me,  living in the boonies with slow internet, even on a good day it’s at least 3 or 4 hours to download a 2.5GB file.

Suffer no more! 🙂 Okay maybe it’s not suffering but…

Microsoft has now provided “Trial Conversion Keys” for MSDN Subscribers.

Just go back to the MSDN subscriber downloads and request the key and you’ll see the new Trial Conversion Key and just apply that to your trial. Done.

I’m sure this meant a few long nerve-wracked nights for MSDN folks since it seems this was done in response to a lot of whining. So hats off to them.

Funky Behavior NoTracking Query Entities

I’ve been using a lot of NoTracking queries to grab lists of data that I don’t need change tracked. It enhances performance and cuts down on resources. There are some nuances about these entities, however.

One of the interesting behaviors of EF4’s Lazy Loading is that even if you have entities that you have queried with NoTracking on, they will still lazy load related entities.

Unless you’ve read this somewhere (it’s on the ADO.NET team’s blog post which introduces lazy loading) or experienced it yourself (that’s me, since I had forgotten about that point in the blog post) you may not expect, or plan ahead, for this behavior.

You’d think that because the entity is not attached  to the context, it would not be able to pull this off. But it does. The related entity or collection will get automatically retrieved and the results are also detached and deep inside of the EntityObject sealed properties, there’s a flag that indicates they are NoTracking entities.

Another surprise is in store when you use NoTracking entities…again it’s only a surprise if you don’t happen to be aware of this behavior and it’s not what you might expect.

Normally when you join a detached entity to an attached entity, EF’s relationship span will kick in and automatically pull that detached entity into the context to be managed. However, this won’t happen with NoTracking entities and you’ll receive a very explicit exception message that explains this. You need to attach the “NoTracking” entity to the context first and then you can attach it to the other entity.

Ken Cox explores EF4’s Pluralization Service with a WCF Service

When I have done “what’s new in EF4” talks at user groups and conferences, I like to show off the new pluralization support in the EDM Wizard. I also like to have a little fun showing some cases where it doesn’t do so well. For example, it correctly singularized Breweries to Brewery, but uses the same rule on Movies, turning it to Movy.

The wizard uses a runtime feature referred to as the Pluralization Service which you can code against yourself.

Ken Cox recently built a WCF Service that uses the pluralization service to provide his own cloud plurlization service. And then ran a bunch of words against it. This is a lot easier than testing it in the designer! Here’s his blog post about the service: EF 4’s PluralizationService Class: A Singularly Impossible Plurality

A warning, though. Do not try to say the title of his blog post out loud or you may not be able to untwist your tongue until EF5 is released!

Today is last chance for EF Profiler 30% discount

Ayende has reminded us that Entity Framework Profiler’s Beta period ends tomorrow when it goes RTM. But that means the 30% discount also ends. It will go from $220US to $315US tomorrow.

I spend a lot of time looking at what’s going on in my database when using EF and the views that EFProf provide are indispensible. It’s organized by context instance and provides links back to the .NET code that executed each command.

I sure wish I had stock in this tool!

efprof