Monday, May 12, 2008

The Astoria Team has provided a very impressive list of what's changed and what's new in the new bits for Astoria that were released with VS2008 SP1 today.

I was surprised to see they already have the Batching and Optimistic Concurrency stuff in there that they were only just recently considering.

Here are my own notes from trying to get an Astoria demo working before I had access to the nice list that is now available.

1) If you are using an Entity Framework EDM as your data source , there are some easy to fix (and easy to discover) breaking changes to the model.

See this post on my notes for updating an Entity Framework solution to SP1.

2) The service file is very different. You will be best to create it from scratch then move your logic into the new SVC file.

3) Namespaces and classes have changed.

  • Microsoft.Data.WebClient namespace becomes System.Data.Services
  • WebDataContext becomes DataServiceContext
  • WebDataQuery becomes DataServiceQuery

4) Methods for limiting access and the enums have changed

OLD config.SetResourceContainerAccessRule("*", ResourceContainerRights.AllRead);
NEW config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);

SetServiceOperationAccessRule stays the same

5) WebDataGen is now DataSvcUtil and can be found in C:\Windows\Microsoft.NET\Framework\v3.5\DataSvcUtil. The parameters for this were simplified, too.

I recommend using DataSvcUtil to recreate any classes you want to use in Astoria clients. I actually fixed one up manually before I found DataSvcUtil and it was a pain.

6) The Attribute used to identify the Key field (needed when the field names are not discoverable by Astoria) has changed.

It was <System.Web.DataWebKey()> and was used on the property.

Now it is System.Data.Services.Common.DataServiceKey(propertyname) and is used on the class. It can also take an array of strings if there are multiple keys.

7) The Silverlight and AJAX client libraries are not included with these bits but the AJAX one is  on CodePlex.

That's two of my four demos from my Astoria talk. I'm currently trying to figure out how to retrofit the old ajax data services library into a new application.

http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=13357

There are probably lots more goodies in there, but these notes represent the pain I had to go through to get my Astoria demos that I'm doing this week at DevTeach working again.

Monday, May 12, 2008 11:52:25 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Along with Soma and others, the ADO.NET team has announced that the next beta of Entity Framework is available with the VS2008 Service Pack 1 BETA bits. The Astoria team already has a list of changes on their blog and there will be one coming for EF as well.

In the meantime....

Never a dull moment. I have two EF sessions this week at DevTeach and have to very quikly overhaul my demos.

Here are some of my notes.

EDMX Changes

Designer section

<edmx:ReverseEngineer /> has to be removed. I guess it was hopeful thinking.

SSDL

New attribute required inside of schema (Provider="System.Data.SqlClient")
These attributes had to be removed: DateTimeKind="Unspecified" PreserveSeconds="true"
ProviderManifestToken Attribute in schema declaration needs to be changed from the version number (eg for SS2005 that was ProviderManifestToken=.09.00.3054 now is ProviderManifestToken=2005.

Designer section is now at the bottom of the file. Nice.

You cannot have both the Design view and the XML view of an EDMX open at the same time.

In the Model Browser window, the XML for various pieces of the model are no longer shown in the tool tips. While there are reasons behind this, I REALLY liked this and am sad to see it go. Now I have to always close the designer and open up the XML and trudge through it if I just want to verify something. Oh well.

Designer Changes

Oh my its pretty! It's cleaned up; the Asscoiation names are no longer clogging up the view, it's more flexible wrt to what's available on context menus and it has some nice shortcut icons for zooming etc.

Update from Model

As per a blog post from Noam Ben-Ami a while ago, this has improved enormously. With some minor excpetions (which I have not experienced) the CSDL stays intact when you update even though teh SSDL will be competely rewritten so any changes there will be lost. If you add new fields to a table in the database, and it's obvious in the model where it should go, it will make it into the CSDL.

Code Generated Classes

Best bet: just delete them and let VS2008 regenerate them.

API Changes that I've experienced so far

It is very nice to have full graphs coming in and out of WCF services. :-)

Believe it or not, I haven't run into anything else so far that has impacted my apps except for the fact that I need to completely rearchitect my WCF solutions now that I have graphs to pass back and forth. Will I get this done before my session on using Entity Framework across tiers on Wednesday? Nothing like being forever behind the 8-ball. :-)

The EntityDataSource control

I am not a big fan of drag & drop, but I'm liking this control so far. Here are some of the things that are winning me over.

Easily use inherited types

Easily do eager loading with the IncludePaths property.
Note: There's a bug which is preventing the combination of eager loading when you are using an inherited types. That will go away with the next available build.

Many opportunities to override behavior. There are lots of events and the most important to me (so far) is the one lets me control what context the control will be tied to. By default, every EntityDataSource spins up its own context. That's not good if you want to have relationship management happening.

Dynamically build queries with the properties or just entier an EntitySQL string as the command text.

Note that the where parameter takes an Entity SQL predicate, just like you would use with Query Builder methods.

That's all for now.

Have fun!

Monday, May 12, 2008 11:49:46 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

 

from Soma:

Visual Studio 2008 and .NET FX 3.5 SP1 Beta available now

Posted Monday, May 12, 2008 9:02 AM by Somasegar

"In the next few hours, the bits for the service pack beta will be available for download here. "

Monday, May 12, 2008 11:37:24 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Colorado man, author and MS Regional Directory, David Yack, is in Vermont to present at the VTdotNET meeting tonight, thanks to INETA.

He'll be speaking on a topic we have NEVER had in our 6 years at the user group: VSTO. THen off to NJ tomorrow to talk about Silverlight 2.0.

But if that's not diverse enough, he's locked in his hotel room wrapping up a book on CRM. Go David! I've conspired with his wife, Julie, to be sure that he does get downtown to go buy some Lake Champlain Chocolates for his wife. We Julie's know how to stick together!

Special thanks to Infragistics and JetBrains for their monthly raffles and to Goodrich (yes, that Goodrich) Vergennes for sponsoring the cost of the meeting space.

Monday, May 12, 2008 7:36:29 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Saturday, May 10, 2008

This week's The New Yorker issue is focused on invention and there is a really fun read on Nathan Myhrvold, Intellectual Ventures, dinosaurs, Alexander Graham Bell and more called In the Air.

Having been on the nosy Lake Washington cruise which goes by his house, Gates' and others, it was funny to read his wife describe their house as "the place in the sci-fi movie where the aliens live".

The article is focused on the process of invention and highlights some of the amazing brainstorming sessions that Myhrvold has with IV participants (including Bill Gates) who's goal is to patent 1000 new inventions a year. They are at about 500 /year now, dealing with everyting from medicine to nuclear fision.

Saturday, May 10, 2008 8:18:49 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Thursday, May 08, 2008

I have found myself explaining this in conference sessions so I thought I would write it down in my blog.

Entity Framework has a Golden Rule. Though shalt not do nuttin' that the developer has not explicitly told you to do. The lack of implicit lazy loading is one of the more notable (and hotly contested by some) example of this.

But one day when I was coding, Entity Framework did something that I did not ask it to do. I emailed Danny Simmons to tattle on the API. But Danny explained something to me about RelationshipSpan that needs to override the Golden Rule.

I now call it the Platinum Rule. (I learned this pecking order from American Express).

The Platinum Rule is that an object graph (for example when a customer is attached to an order which is attached to some line items) must be completely in or completely outside of the ObjectContext.

The way I discovered it was that I had a Customer that was being change tracked by an ObjectContext.

I created a new order and attached the order to the customer.

But I did NOT add or attach the order to the context.

Yet, the order was suddenly within the context and being change tracked. Why? Because of the Platinum rule. By attaching the order to the customer, I was creating a graph. Since the graph can't have some of its objects in the context and some of its objects out of the context, it has three options.

  1. Don't allow the objects to be connected. (Now wouldn't that tick you off?)
  2. Pull the customer out of the context. (Now wouldn't that really tick you off?)
  3. Pull the order INTO the context.

Okay, works for me.

So this is the same rule that confuses people when they have an object graph that is IN the context and they detach one of its objects. That object leaves the context and "broken"off of the graph. So if you called context.Detach(Customer), then the customer is detached but the Order and its Line Items are still in the context.

You can no longer traverse from the Customer to the Order or from the Order to the Customer.

On the flip side, if you have an object graph that is not being change tracked  - the whole package, Customer, the order and the details and they are all attached to one another, if you attach any one of them to the context, the whole kit n' caboodle gets pulled into the context - because of the platinum rule.

Thursday, May 08, 2008 8:05:42 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 

Like Jeremy Miller, who has Transparent Lazy Loading for Entity Framework on his Christmas Wish List, Timothy Khouri does not like the fact that Entity Framework doesn't support Lazy Loading. However, since he really likes Entity Framework, he wrote some code that will enforce Lazy Loading for him. Entity Framework promises not to do anything you don't explicitly tell it to do, so Timothy found a way to keep telling EF to do this for him because that's what he wants.

After looking at LINQ to SQL's Lazy Loading and then bumping into Entity Framework's explicit Deferred Loading, then sorting things out so he understood not only how the two are different but why, he shares his lesson and his workaround in this article: Entity Framework and Lazy Loading

Thursday, May 08, 2008 7:52:18 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 

Pete left a valuable comment that the hyperlinks were much too subtle in my blog posts. So I changed the link color to orange and its everywhere. It definitely stands out, though I doubt I'll get a design award for it - just clashes a bit. Feel free to suggest a different color if you want!

Thursday, May 08, 2008 7:10:18 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  | 
 Wednesday, May 07, 2008

Entity Data Models have a lot of rules. They are necessary for the integrity of the model, though if you are not familiar with depth of EDMs and *why* these rules exist, many of the mapping rules may seem to make no sense when it comes trying to implement them. This gets hairy when you are mapping stored procedures. Roger Jenning's solution is to create stored procedures that will map properly, rather than suffer wtih the ones that already exist.

The first level of using Stored Procedures is that they work very easily for existing entities that are simple, have no EntityReferences (these involve Foreign Keys) , don't involve inheritance and map directly to a single table in your database.

The next is stored procs that map nicely to entities which don't involve inheritance but if your entities have any relationships, you will probably run into a wall with a delete procedure. Here's why.

Stored Procs become Functions in the Entity Data Model. If you want to use these functions rather than the dynamic SQL that Entity Framework will create, it's an all or nothing scenario. You need to map an Insert, and Update and a Delete. (Read procs doesn't come into play here). There are plenty of blog posts and other resources on how to do this including this tutorial I wrote for the DataDeveloper.net site.

If you have a relationship in your entity, you can map that easily enough to a foreign key parameter in the function mappings and this makes sense with Inserts and Updates. With deletes, generally you only have a primary key (eg ContactID) as the parameter for the stored procedure. But here is where the EDM rules come in to play. A foreign key value that is used in a stored proc, would in most cases map to the EntityKey of a navigation property.

In other words, if you have a stored proc to insert SalesOrders, that procedure will have a parameter for CustomerID. The Order Entity this is mapping to has a relationship to the Customer entity and contains a Customer navigation property. The mapping therefore would link the CustomerID paraemter to Order.Customer.CustomerID.

By doing this, you are involving the association that exists between the Customer entity and the Order entity.

The EDM rule is that if you are involving an association in ONE of the function mappings, you have to use it in ALL o the function mappings.

Therefore a stored proc to delete an order, which only has an OrderID parameter will need also to have a CustomerID parameter because you are required to map SOMETHING to the Customer entity.

This then breaks a possible rule. It means you need to go to the dba and beg them to add this parameter into the stored procedure even though it doesn't get used.

The alternative is to just go in and modify the SSDL to trick it into thinking that that parameter exists which will make the model happy and the database won't care at all. IT doesn't ever really get used.

So if the actual stored proc is

PROCEDURE DeleteOrder

@OrderID int

AS

DELETE from ORDERS WHERE OrderID=@OrderID

and the original function in SSDL is

 <Function Name="DeleteOrder" Aggregate="false" BuiltIn="false" NiladicFunction="false"
            IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
     <Parameter Name="OrderID" Type="int" Mode="In" />
 </Function>

You just need to add a new parameter to the SSDL

 <Function Name="DeleteOrder" Aggregate="false" BuiltIn="false" NiladicFunction="false"
            IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
     <Parameter Name="OrderID" Type="int" Mode="In" />
     <Parameter Name="CustomerID" Type="int" Mode="In" />
 </Function>

This is all fine and good until you need to update the model, because the SSDL will lose all customizations.

I keep my customizations listed in a separate text file so that if I must update the model,  I can replace them.

It's not pretty, but when I don't have a lot of customizations, I will choose this over bugging the dba. Okay, in my world, I'm the DBA (how pathetic is that) but I'm trying to think about enterprise developers and real DBAs.

I started out wanting to write about dealing with stored procs for entities that are inherited, but I guess that will have to come later!

Wednesday, May 07, 2008 1:33:03 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I was perusing Chris Williams' blog over on GeekswithBlogs.Net. I met Chris many years ago through INETA and in person at an INETA User Group Leader event. Chris ran the user group in Charleston, South Carolina and has since moved to Minnesota where he has survived his first winter with all of his fingers and toes intact. He is a really nice, unique and memorable guy (okay the tat's definitely help him stand out).

While looking at his blog, I saw a post of photos from a funny ad that apparentlyly reminded Chris of D'Arcy Lussier, a a wild and crazy guy (also a GeekswithBlogs blogger) who lives in Winnipeg (where I think you need to be a little wild and crazy to survive), and probably laughs at Chris' mumblings about the cold weather in Minnesota. D'Arcy also is a user group leader and I see him frequently at the DevTeach events in Montreal and look forward to seeing him at DevTeach next week in Toronto where I plan to goad him into a his own Meatloaf imitation. (I didn't realize that the dad in the commercial really is Meatloaf!)

What struck me when I saw the photos and Chris' comments about them was that here are two guys who have a lot in common and are clearly good friends who may never have met if it weren't for INETA and the .NET blogging community. I know it may seem obvious that of course they would find each other, but it's not a given. These resources were only just starting up 6 years ago, so they are relatively new.

It really made me stop and think when I saw that blog post and made me happy and very proud of the community that we have all created.

Wednesday, May 07, 2008 8:10:13 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  | 
 Tuesday, May 06, 2008

And I haven't even had a chance to look at any presentations yet.

Here's what's on my schedule so far.

  • Monday morning - speaker training
  • Monday afternoon - INETA User Group Leader Meeting (yay!)
  • Monday evening - Speaker dinner
  • Tuesday 1-2: Vista Ask the Experts Booth demoing Annotation in Silverlight
  • Wednesday Lunch: Women in IT Panel (yay)
  • Wednesday 2:45: Birds of Feather "Is Entity Framework right for your application?"
  • Wednesday 7pm: Birds of Feather with Steve Smith: "Going Solo"

(and the real reason I'm going)

  • Thursday 10:15 - 11:30 am  Advanced Entity Framework: Take Charge of Object Services
  • Thursday 2:45 - 4:00pm Microsoft .NET Framework 3.5 Data Access Guidance

And then as soon as I finish my session I have to run to the airport to catch a 6:45 flight. (and miss the attendee party, duh)

So this is starting to look like one of the conferences where I don't get to go to sessions. Because all of the rest of the time, I'll need to be in a quiet place practicing my sessions and writing my book!

Tuesday, May 06, 2008 8:54:17 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Don't pencil it in; ink it in!

May 22nd at Vermont Technical College in Williston from 9am to 4pm.

You may notice that May 22nd is on a THursday. I will put money on the fact that Chris scheduled this so that he can go to Bove's. THe last few times he hit town at the beginning of the week, but Bove's is closed on Sundays and Mondays and I think I heard the sobs all the way down here in Huntington. Thankfully, he discovered The Skinny Pancake down by the water front and is now a fan of that resto, too!

Read more details about the roadshow on Chris' blog!

Tuesday, May 06, 2008 10:25:05 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

It was pointed out to me recently that I've gotten a bit lazy with my coding. I completely blame it on implicitly typed local variables. Read more here...

[A New DevLife Post]

Tuesday, May 06, 2008 10:21:49 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Monday, May 05, 2008

 

spring 002 (Custom)

spring 003 (Custom)

Veggie garden's ready in case I ever get ready. I did already put some lettuce and peas in on the left.
Only super hardy stuff goes in now. We can't do our regular planting (tomatoes etc) until after Memorial Day.
Short growing season in Vermont.

spring 004 (Custom)

Compost is ready and waiting.

spring 005 (Custom)

Lupine are coming up. They are SO hardy.There are hundreds of them in the front field. Looks amazing in early June!

spring 006 (Custom)

The front garden has already got blooms in it and everything else is growing like mad. 

spring 007 (Custom)

And the winner is.... the first tulip opened today.

spring 008 (Custom)

Columbine will be in bloom in another month. They spread on their own so there's a bunch of this.

spring 009

This lilac is making flowers for the first time this year. It's neighbor is still flowerless. Maybe next year.

spring 010

Lots of Lilies. There are also miles of bee balm along this fence as well as berries and lupine and a very hardy delphinium.

spring 011 (Custom)

Is this bucolic enough? I love this ancient Maple tree down by our mailbox.

But best of all, my favorite flowers are STILL here

tasha may 2008

Tasha, now 14 1/2 which is insanely old for a Newfie.

spring 017 (Custom)

And Daisy, the puppy in the house. She's 13 1/2.

Monday, May 05, 2008 1:19:00 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 
 Thursday, May 01, 2008

I am thrilled to share this fabulous news ... INETA Noram has a new website. The reason for my jubilation is that for a variety of reasons, INETA has been trying to create a new website for about 4 years, so to see it actually happen is wonderful.

This may have just launched because I hadn't heard anything about it yet or maybe I overlooked it in the last newsletter.

Not only does it have a new look but it has some long awaited features such as an integrated map to find user groups. They have partnered with Component Source so you can buy .NET components right from the site.

I also found the live.ineta.org website that I didn't know about. It has videos (user group YouTube?), a blog that lists things like upcoming code camps and INETA related events and some other resources. 

Thursday, May 01, 2008 10:18:25 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Wednesday, April 30, 2008

This week I had to make a very difficult decision. It will make you laugh, but really, it was hard.

I had to decide if my book will say "Julie Lerman" or "Julia Lerman".

After a LOT of deliberation, I decided to go with my grown up name: Julia Lerman. Which means that any searching on Amazon or whereever for "that book by Julie Lerman" won't find it.

Wednesday, April 30, 2008 8:36:36 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [6]  | 
 Monday, April 28, 2008

EntityStateObjects, to me, are one of the most important little pieces of the EF puzzle. IT is the EntityStateObject that maintains all of the critical info for change tracking. But it's hard to get the big picture of what's going on in there when debugging because all of the important stuff is delivered through methods, not properties.

I wanted so badly to write a debugger visualizer for them but they are not serializable (big pout) so instead, I wrote an extension method that uses a ConditionalAttribute to ensure it doesn't pop up during run time. It's for my book but I didn't want to hold onto it until October when the book should be published.

Since it's not a Debugger Visualiser, I refer to it as a DebugTime visualizer. :-)

Here's what my ObjectStateEntry Visualizer looks like in action:

All of the info is pulled from the ObjectStateEntry. At the top it tells the fully qualified name of the type of the object being inspected as well as the object's EntityState.

Then I use the various methods of the ObjectStateENtry to get the Original Values, the Current Values, the names of the fields and a list of the names of the modified fields.

All of this data I feed into the grid.

If the object is detached, then there is no ObjectStateEntry and the visualizer shows this message when you try to run it:

So enough with the screenshots. Here's the code. And here's a collection of important punctuations for you C# programmers who feel a need to translate

[ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;  ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;  ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;  ; ; ; ; ; ; ; ; ; ; ; ; ; ;]

 

Imports System.Runtime.CompilerServices
Imports System.Data.Objects

'NOTE: The objects in use here are not serializable so they can't be used
'in debugger visualizers. Instead, you'll need to use them directly, but you can 
'give them a debug attribute so they are only available during debug mode.
<Extension()> _
Public Module Visualizers


  <ConditionalAttribute("DEBUG")> _
  <Extension()> _
  Public Sub VisualizeObjectStateEntry(ByVal eKey As EntityKey, ByVal context As ObjectContext)
    Dim ose As ObjectStateEntry = Nothing
    If Not context.ObjectStateManager.TryGetObjectStateEntry(eKey, ose) Then
      Windows.Forms.MessageBox.Show("Object is not currently being change tracked and no ObjectStateEntry exists.", _
"ObjectStateEntry Visualizer", Windows.Forms.MessageBoxButtons.OK, Windows.Forms.MessageBoxIcon.Warning) Else Dim currentValues = ose.CurrentValues Dim originalValues = ose.OriginalValues Dim valueArray As New ArrayList For i = 0 To currentValues.FieldCount - 1



'you can get from the ObjectStateEntry into the MetaData which actually comes from the EDM
Dim sName = currentValues.DataRecordInfo.FieldMetadata.Item(i).FieldType.Name Dim sCurrVal = currentValues.Item(i) Dim sOrigVal = originalValues.Item(i)
'nothing like a little LINQ query to find some info Dim changedProp = (From prop In ose.GetModifiedProperties Where prop = sName).FirstOrDefault Dim propModified As String propModified = If(changedProp = Nothing, "", "X")

'the funky property naming in this anonymous type is to get around a wierdness with
'LINQ databinding that only occurs in VB - it alphabetizes the fields
valueArray.Add(New With _
{._Index = i.ToString, ._Property = sName, .Current = sCurrVal, _
.Original = sOrigVal, .ValueModified = propModified}) Next Dim frm As New debuggerForm With frm.DataGridView1 .DataSource = valueArray End With frm.lblState.Text = ose.State.ToString frm.lblType.Text = ose.Entity.ToString frm.ShowDialog() End If End Sub End Module

The form has no code, just a few controls:

I created an assembly for my Entity Framework extension methods and just reference the assembly anywhere I want to use it.

Then when I want to use it, I call it against the EntityKey of an Entity Object:

  context = new AWModel.AWModel.AWEntities();
  cust = context.Customers.Where(c => c.CustomerID == 223).First();
  cust.CompanyName = "JULIE COMPANY";
  cust.EntityKey.VisualizeObjectStateEntry(context);

This has been an enormously useful tool for when I have been presenting as well as just working.

Enjoy!

Monday, April 28, 2008 8:07:48 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Sunday, April 27, 2008

Along with a few hundred other DevConnections attendees, I got a sneak peek of the EntityDatasSource control on Monday during Danny Simmons' Entity Framework Architecture session.

 

I think I paid more attention to the control than what Danny was saying because I was desperate to see how it was set up.

 

Before digging in though, I also wanted to note that the UI of the EDM Designer looks really pretty. I noticed that the association lines/connectors looked different; the whole thing was cleaner looking (were the association names gone?) and the Entities have their own little representative icon now. I can't wait to see this in more detail.

 

The EntityDataSource wizard identifies EntityConnections in the config file and offers those to as choices for building the data source from. Once that is selected, the EntityContainer is also identified, offering the list of EntitySets from the container to use for the data source.

 

Like the LINQDatasource, you have the option of selecting all of the properties at once or selecting specific properties which will perform projection. Like the LINQDataSource, if you project properties, then you won't get a full type back and the data will not be updatable.

 

There was a drop down list below the one where you choose which EntitySet you want to work with but I don't recall what it's name was. Danny did not drop it down. All I can think of that might be there (hopeful) is derived types since they don't have their own EntitySet.

 

Although I don't remember seeing it during the session, Danny did say that you can choose to eager load related data in the same way that you can with the Include method. I don't know how this is done or if it will impact updating, but I don't know why it would.

 

Like the LinqDataSource,  the EntityDataSource performs server side paging, and it does client side caching - of current AND original data. The original data is not stored as complete objects, but the minimal data necessary to reconstruct state when it's time to update. Updates happen, like any other data source, one at a time. So you have to pick an item, edit it and update it.

 

 I've got some of my own examples of using series of entities in web apps which are very different from this. My solution, however, is aimed at a different scenario. Where the EntityDataSource is more scalable because of the server side paging and the fact that it is not caching full objects, my solution allows the user to do a bunch of edits then save them all at once. I keep the objects in the client side cache (I know - horrors! - but it's an option for a developer to choose) and a collection of original objects cached on the server, though it's an application cache, not a session cache.

 

Seeing the EntityDataSource has already given me some ideas of taking my solution and making it more scalable without losing the benefit of the bulk editing.

 

I can't wait to get my hands on the new bits!

Sunday, April 27, 2008 8:20:30 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Saturday, April 26, 2008

It's been in there from the start (well at least since VS2003), but I have only recently started taking advantage of the "Format Document" and "Format Selection" functions in Visual Studio to help with the readability of code or xml. Read more...

[A New DevLife Post]

Saturday, April 26, 2008 9:14:09 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 
 Friday, April 25, 2008
I COPIED THIS ENTIRE BLOG POST DIRECTLY FROM GUY BARRETTE'S BLOG and made one little edit! So shoot me! :-)
 

If you're living in Toronto and don't attend DevTeach, [Guy Barrette says he's] gonna beat you up and force you to code in Clipper for the rest of your life.  Seriously, DevTeach has one of the greatest speakers lineup of all the .NET conferences.

Honestly, where can you hear, see, talk to, describe your problems (IT/Dev related or not) and have a beer with these guys/gals?

Scott Bellware Benjamin Day Oren Eini Cathi Gero Barry Gervin The one and only Kate Gregory YAG The Zen of Scott Hanselman Moi Beth[mond] Massi Kevin MacNeish Ted Neward Roy Osherove Rodman Partyboy Palermo Paul [Yes, it's true. I live on a boat] Sherriff Joel Semeniuk Richard Campbell Peter DeBetta Don Kiely of the Alaska Keilys Bill Vaughn Adam Machanic Carl Franklin Rob Windsor Jim Duffy

And that's only half of them!!!

Need more reasons?

Keynote by Scott Hanselman, Microsoft
Scott Hanselman is one of the most prolific, renowned and respected blogger (
http://www.hanselman.com) and podcaster (http://www.hanselminutes.com) about technologies. Scott is a hands-on thinker, a renowned speaker and writer. He has written a few books, most recently with Bill Evjen and Devin Rader on Professional ASP.NET. In July 2007, he joined Microsoft as a Senior Program Manager in the Developer Division. In his new role he'll continue to explore and explain a broad portfolio of technologies, both inside and outside Microsoft. He aims to spread the good word about developing software, most often on the Microsoft stack. Before this he was the Chief Architect at Corillian Corporation, now a part of Checkfree, for 6+ years and before that he was a Principal Consultant at STEP Technology for nearly 7 years.
http://www.devteach.com/keynote.aspx

Silverlight 2.0 workshop
For the first time an independent conference is having a workshop on Building Business Applications with Silverlight 2.0.  Join Rod Paddock and Jim Duffy as they give you a head start down the road to developing business-oriented Rich Internet Applications (RIA) with Microsoft Silverlight 2.0. In case you just crawled out from under a rock, Microsoft Silverlight 2.0 is a cross-browser, cross-platform, and cross-device plug-in positioned to revolutionize the way next generation Rich Internet Applications are developed. Microsoft’s commitment to providing an extensive platform for developers and designers to collaborate on creating the next generation of RIAs is very clear and its name is Silverlight 2.0. In this intensive, full-day workshop, Rod and Jim will share their insight and experience building business applications with Silverlight 2.0 including a review of some of the Internet’s more visible Silverlight web applications. This workshop is happening on Friday May 16 at the Hilton Toronto.
http://www.devteach.com/PostConference.aspx#PreSP

Bonus session: .NET Rock host a panel May 14th at 18:00
This year the bonus session (Wednesday May 14 at 18:00) will be a panel of speakers debating the Future of .NET. Where is .NET going? How will new development influence .NET and be influenced by .NET? Join Carl Franklin and Richard Campbell from .NET Rocks as they moderate a discussion on the future directions of .NET. The panellists include individuals who have strong visions of the future of software development and the role that .NET can play in that future. Attend this session and bring your questions to get some insight into the potential future of .NET! This bonus session is free for everyone. Panelists are: Ted Neward,Oren Eini ,Scott Bellware
http://www.devteach.com/BonusSession.aspx

Party with Palermo, DevTeach Toronto Edition
Jeffrey Palermo (MVP) is hosting Monday May 12th in Toronto is acclaimed "Party with Palermo". This is the official social event  kicking off DevTeach Toronto. The event is not just for the attendees of Toronto it’s  a free event for everyone. It’s a unique chance for the attendees, speakers and locals  to meet and talk with a free beer.   The event will be held at the Menage club  location and you need to RSVP to attend. Get all the details at this link:
http://www.partywithpalermo.com/

Make sure that DevTeach comes back to Toronto.  Register right now for this year's conference.

Friday, April 25, 2008 9:18:28 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 


<