All posts by Julie

Designer Support for One-Way navigations in Entity Framework 4

In EF v1, it is possible to have one way navigations where you have an association between two entities but a navigation in only one of them. But the designer didn’t support this. If you deleted a navigation, the association was automatically removed.

You could, however, go into the XML and remove the navigation property manually, leaving the association, association mappings and the partner navigation property in tact.

The new designer now supports one way relationships – both for models with foreign keys and models without foreign keys.

Here is a model that does not use foreign keys. The associations, by the way, are called “independent associations” when there is no foreign key involved.

I start with a Customers property in the CustomerType entity and a CustomerType property in the Customer entity.

TwoWayA

Delete CustomerType.Customers and association and Customer.CustomerType property are still there.

twoWayB 

Next, I delete the CustomerType.Customer navigation property but the association/relationship still remains in tact. The navigations are no longer exposed in the classes but you the model is still valid as are the generated classes (I’m using the default code gen).

TwoWayC

If you want the association to be gone, you have to explicitly delete it. But for this case, you could just delete the association to begin with and the navigations will automatically be removed. That is the same behavior as in EFv1.

Although the screenshots are from a model with independent associations, the behavior is the same for foreign key associations.

Why the “no-way” association? Either there is some unknown-to-me value to having the association defined in the metadata, or it is the only way the designer is able to pull off keeping the association intact as a result of removing a navigation.

I have asked about this last bit and will share what I learn.

In the meantime, now that it is more discoverable and simpler to create one way relationships, I bet more people will take advantage of it.

Not quite Vermont IT Jobs: .NET developer in Portland, Maine

Council on International Educational Exchange

.NET Application Developer

Reports to: Director, Application Development

Location: Portland, ME

Summary of Position

This position is responsible for developing system(s) to support business needs as defined by the current and future business requirements. The incumbent will also be required to integrate existing systems with new system as the business or technical demands evolve. Additionally, the position should constantly be challenged to define areas that will benefit from automation and/or electronic commerce.

Primary Responsibilities

  • Designs and Develops proposed software solutions:
  • Maps business requirements to a physical model
  • Adopts and maintains programming standards to continually improve quality of applications software.
  • Ensures that established development methodology is followed.
  • Ensures that system, program, and job documentation is complete and current.
  • Performs thorough unit and integration testing and acts as QA for other team members when required
  • Monitors user acceptance testing as required.
  • Evaluates/audits operational applications as requested, and recommend any performance improvements that could be made.
  • Performs program design and development activities as required.
  • Maintains production applications as required.

Knowledge and Skills

  • 5+ years experience with object oriented languages
  • Programming experience with relational databases (specifically, Microsoft SQL-Server)
  • Experience with object oriented development tools (C#.NET, ASP.NET, VB.NET, XML)
  • Experience with Agile Development methodologies
  • Must be able to work well in a team environment

Due to federal regulations, a background check will be conducted as a condition of employment.

Benefits
CIEE is committed to providing a competitive benefits package for our employees. The benefits package is reviewed and updated annually. The following is a sampling of the benefits you receive at CIEE. Most benefits apply to “regular” employees who work 35 hours or more each week.

  • Medical
  • Dental
  • Vision
  • Flexible Spending Accounts
  • Holidays and Vacation
  • 403b Retirement Plan with a generous company match
  • Disability Insurance
  • Life Insurance
  • Employee Assistance Program
  • Full service in-house workout facility and locker rooms
  • Employee Computer Purchase Program
  • Group discount on auto and home insurance

Since 1947, the Council on International Educational Exchange, known as CIEE, has been in pursuit of its mission, “to help people gain understanding, acquire knowledge, and develop skills for living in a globally interdependent and culturally diverse world.”
CIEE is the leading U.S. non-governmental international education organization. CIEE creates and administers programs that allow high school and university students and educators to study and teach abroad.

Today, CIEE is composed of two interrelated but operationally independent entities based in the Old Port of beautiful Portland, Maine across the street from the a working sea port.

Interested candidates please email a cover letter and resume to cieeresume@ciee.orgPlease put “Application Developer” in the subject line.  We will contact those candidates we would like to meet with to further discuss this exciting opportunity. No phone calls please. Relocation assistance is available.

Eager Deferred Loading of related entities

“Eager Deferred” is a bit of an oxymoron, but let me explain.

Example:

You have queried for customers.

For particular customers you want to get their orders AND order details.

customer.Orders.Load will only get the order entities.

But what if you wanted to do something similar to Include in there?

eg customer.Orders.Load.Include(“Details”)

That syntax is not possible. and is something Ben S added to the Entity Framework v2 Wish List started by John Papa.

Here’s how to pull it off in V1, as explained by Danny Simmons.

customer.Orders.Attach(customer.Orders.CreateSourceQuery().Include(“Address”))

It’s logical and it works, but it’s awfully convoluted. Two years of futzing with Entity Framework and 300 pages into my book and yet, here is something I have never seen or thought up before. And while it’s a neat trick, it’s still pretty hard to get to.

I much prefer the Load.Include() idea. It’s discoverable and feeds on something we already know how to do. But for now, at least I know how to do it in V1.

There’s so much in V1 and for many scenarios where you think you are stuck, whether it’s with the model or with code, as with Danny’s example, EF and EDM are robust enough that there is generally SOME way to pull it off. But it takes a good understanding of the APIs or someone like Danny sitting by your side to figure some of these things out.

Another great example is Jarek Kowalski’s code to perform transparent Lazy Loading in EF. Lack of lazy loading has been an EF showstopper for some, but it is possible to add it in.

More of this functionality will be hidden under the covers in V2 with much simpler ways to tap into it (at least I”m assuming and counting on this for V2). For now, folks (on the team and in the community) are writing extensions and code to make many tasks easier to perform. Don’t forget to check out the team’s code gallery (http://code.msdn.microsoft.com/adonetefx as well as the www.codeplex.com/EFContrib site.

Tips, Tricks, SerialPorts and Cupcakes at VTdotNET last night

Last night was one of the smallest meetings that we have had for VTdotNET in a long time – could it have been the 90 degree temps? The fact that schools out around the area and folks are on vacation? Well, they missed out because we had a blast.

Carl Lorentson from Renaissance Info Systems, shared a bunch of .NET Tips & Tricks. One of them solves a problem that I have had for a long time using WIndows Forms which is a very specific scenario (his matches mine) when the designer won’t open up. I have to write another blog post about that, stay tuned! He also showed some great ways he has used reflection to solve problems and gotten over the fear of extending controls. A very cool custom control he showed was a combobox that knows how to display data that is no longer part of the drop down list. In other words, if Vermont ceded from the U.S., you would still be able to see "VT" in an address display, even though Vermont was no longer in the drop down list as a selectable option.

After Carl, we got super geeky as Nick Fessel, from Cooper Controls, showed us not only how the System.IO.SerialPort class works, not only how to program an app that talks to a controller, but how to program a controller! In 20+ years of programming, I have never seen anything like this before We even got the old red & Green lights and numeric displays on teh controller. We talked a bit about Robotics Studio (something else I need to blog about because a few recent events has this high in my mind). What was funny was that Nick told us that he had actually programmed the lighting in the room where we were having our meeting. The old "clap on clap off" joke was repeated throughout the rest of the meeting.

During the day, since I have been in a bit of a funk and am having a hard time focusing on my work, I baked cupcakes. But those are a dangerous thing to have laying around the house. Therefore, I brought half of them to the meeting and everyone got a cupcake. There were some new folks at the meeting, and I assured them that this does not happen at every meeting!

So it was really fun to have a small VERY geeky meeting and also to see VTdotNET members be willing to share what they are doing at work or some of the challenges they have overcome. I really hope we can have more meetings like this in the future (including cupcakes, of course!)

Thanks again to Champlain College’s Department of Software Engineering for covering our room fees for the summer, to Infragistics for a NETAdvantage raffle, to JetBrains for a ReSharper Raffle and to APress for a bunch of books we raffled off as well.

Cheer up!

Okay, I have depressed way too many people in sharing the sad news about having to put both Tasha and Daisy to sleep in the past week.

Here’s how I cheer myself up though, by walking around my house and admiring all of the new life.

The peonies are getting ready to pop!
garden 002

The Rhodedenrons were amazing when I got home and still are. This picture does not do justice to how spectacular they truly are and how much they are glowing. It’s supposed to rain today so that might take them out since the petals are already starting to drop.rhodies

This, one of a number of Clematis, is growing like crazy.
garden 006

This is a corner of the field. I cannot figure out how to take a picture of 2 acres of Lupine with some phlox mingled in.garden 010

The glam irisies are opening and the siberians are just getting started.irises sibirises

Columbine in many colors.
columbine2

Something we can’t believe survives through our winters, a Japanese Maple.garden 015

And the last few pansies waiting to get put into pots.garden 016  

Hope that helps!

Oh, yah, TechEd

TechEd was a whirlwind and I never had a chance to breathe, much less blog. I plan to catch up with a few posts but I wrote this one on the plane coming home before I passed out from exhaustion.

I blew in on Tuesday afternoon rather than Sunday (first delay, second delay) and immediately did an Ask the Expert session  on Silverlight Annotation which was a blast. It was non-stop the entire time I was there. After the session, Stuart Celarier appeared to tell me my Entity Framework BOF, which I thought was the next day (!), was starting and it was a long walk (which I ran the entire way carrying two back packs) to get there. There were about 70 people there and I was happy to meet David Sceppa and Ward Bell in person finally. David is also writing an E.F. book (for MS Press) so we played tag team with a lot of the questions (and I thought a great team, at that!) A BOF is supposed to be a conversation, and I kept trying to throw the discussion back to the group, but I just couldn’t steer it away from a Q&A session – which of course, with the help of some very knowledgeable people who were there, was a lot of fun.

As soon as that was done, I had to go back to my hotel (little did I know that the route I chose was the long way around to the hotel) for a quick change and head to an awesome dinner (at Emeril’s) which deserves its own blog post. The short story on the dinner was that it was a small dinner with Somasegar, Tandy Trower (who has been at Microsoft for over 26 years and currently is the GM for the Microsoft Robotics Group) and Robert Wahbe.  Technically, I had the least in common with Tandy, but he and I had the most fun and I’m looking forward to getting him to come to Vermont someday. It’s interesting to me that I am tagged somewhere as “blogger” which is why I get invited to do things like this and the Mix n Mash event, as opposed to “community person” which defined the attendees of the Bill Gates luncheon. But the beauty of this is that I end up getting the best of both worlds! After dinner I headed back to the hotel where of course, plenty of my pals who I haven’t seen in a while were easily found in the lobby bar.

The next day it was go go go again with the Women in IT luncheon which was as packed as it has always been even when TechEd was combined Dev & I.T. It was a huge pleasure and honor to be on the panel with some amazing women and of course, the one and only Eileen Brown as the moderator. I think more than anywhere, I was totally in my element at this event.

After that I was very fortunate to spend quite a bit of time with Brad Sarsfield who is one of the performance guys in Data Programmability. I had a perf demo that I was dissatisfied with and learned a ton while we worked out what might be causing what looked like a not very credible result.

Then I ran to the next BOF, “Going Solo” which Steve Smith and I co-hosted.It was an awesome conversation with a nice balance of solos and “solo curious”. Steve is a good organizer. I played Carol Merril to his Monty Hall.

After that it was time for a little partying (a very little partying as it was a school night for me). There were a bunch of parties that night. I attended one of them for an entire half hour! That was the sum of “play time” for me at TechEd. Then back to the hotel to work until the wee hours followed by Thursday with my two talks nearly back to back. I at least took some time out for lunch where I got to catch up with Joe Stagner and Stan Spotts and about 5 minutes with Brian Loesgen before I had to bolt yet again.

My last talk ended at 4 and I had to bolt (yet again) for the airport immediately after that! So that was it. I blew in, did my thing and left. Now I’m on my way home to Vermont where I will get to spend the ENTIRE summer. I’m going nowhere until “fall conference season” starts up with PDC and DevConnections and maybe one or two others. And of course, I have a wee bit of writing to catch up on.

Sad news

For those of you who have read my blog for a long time, you have seen me write about and post pictures of my Newfoundland dogs Tasha and Daisy. For those of you who know me, I’m one of those “wierd dog people” – they are more than pets to me, way more.

On Sunday as I was about to head to the airport for TEchEd, I got a call from the place where I had boarded Tasha, the 14 1/2 year old (very very old for a Newfie). SHe had taken a very bad turn overnight – I think gave up her raison d’etre because I had left her there. I rescheduled my flight and RIch and I went to be with her and knew it was time, so we put her to sleep. She devoured a startling amount of cookies and turkey jerkey in her last minutes and right up to the last moment, was scrounging around the floor for crumbs, which gave us a needed laugh. I think she was trying to disprove the theory that you can’t take it with you. And the fact that she was very busy eating was a nice reminder that she wasn’t upset or worried – well, just worried about not being able to get cookies any more.

I went to TechEd early on Tuesday morning, leaving behind our other very old (13 1/2) girl, Daisy who was very depressed about Tasha and not eating. Daisy has had a problem with her esophagus passage shrinking and over the past few months this has caused her some big trouble a few times. Rich did an amazing job with her while I was gone, putting food in the blender, soaking it a lot, discovering that she is a big fan of Ensure. I got home very late on Thursday night. She had a very bad day and a very very bad night on Friday. SO yesterday, knowing that this wasn’t something that could be fixed, we made the difficult decision (moreso because we had just put Tasha down) to let her go as well.

The decision was a no brainer for each dog, but especially difficult for me becasue I was so close to them and I lost them both within one week. And of course, I’m feeling very sorry for myself missing my girls and being in a suddenly very empty and quiet house.

But this isn’t a tragedy. The dogs had amazingly long lives and great ones and we were really lucky to have them with us for so long. It’s just sad to lose your friends, as we all know.

A good cure, of course is a new puppy (and one of my mom’s males sired a litter of 8 that was just born yesterday — only  few hours after saying goodbye to Daisy), but since we have been nursing these old dogs for a number of years, we’ve decided to take a little break before we jump in again. We’ll see how long that promise lasts, though! 🙂

I’m going to leave the comments off of this post.

Silverlight 2.0 Beta2 (and VS Tools and new CTP of Expression Blend) released

Late last night, Scott Guthrie announced (and provided his usual extensive details and samples) that Beta2 for Silverlight 2.0 was released along with a new version of the VS2008 tools (compatible with the VS2008 SP1 release) and a new CTP of Blend! I also found a few minor API changes so far, one that impacts the InkPresenter (which is now on the toolbar in VS2008 tools) and one that impacts tooltips. Read more here…

[A New DevLife post]

 

A better Include method for eager loading in Entity Framework?

Matthieu has written a very clever method extension that allows the important eager loading method, Include, to accept a lambda expression (strongly typed) rather than a string for its parameter.

I like this better than my method of ensuring that I type the strings correctly, which is to start entering the parameter without the quotes and let intellisense help me, then add the quotes after the fact.

Here is the actual documentation that covers Include (look under “Query Path” in this topic) if you’re not sure what we’re talking about.