Posted By: Mike Taulty | Jul 25th @ 3:31 AM
Looking at how we can built a basic .NET client against an ADO.NET Data Service
Rating:
0
0
Dr Herbie
Dr Herbie
Half the population have below average IQ
Can you really only link entities with that proxy.AddLink(newc "Orders", newO) syntax?  That's appalling!  Can't you just do newC.Orders.Add(newO) ?  You know, like normal OOP code would?
Having to enter the name of a property as a string is a recipe for disaster too.  How much time is going to be spent correcting typos when code doesn't work?  It can't be a compile-time check can it, it's going to lurk there until runtime when you get an obscure error about not finding property"Order" because you forgot the 's' in the end.

I have been holding off going to NHibernate until the entity framework finalised so I could compare them. If this is anything to go by I might just go and add the NHibernate website to my favourites because I've got a feeling I'll be spending a lot more time there ...


Herbie
This is great, but it doesn' appear to work AS well for Entity Framework when you are using inherited types (Table Per Type).  I am able to retrieve full data (including the entire derived data fields) based on the common object id (I use a Guid).  But unlike accessing the data directly (where I can specify a where clause on some of the derived class properties) it seems that I cannot achieve this when accessing the data through the service.  So for example, if my derived type has a field 'Name' then I can't query with [from c in entities.DbObject where Name == "Mike"].  Doing this directly requires (AFAIK) the use of the OfType<T> extension on the root object (in this case, 'DbObject' is the base type) but the Data Service clearly tells me that I can't use it.

Is this accurate, or is there something that I'm missing?

-mdb