Mike Taulty's Blog
Bits and Bytes from Microsoft UK

May 2008 - Mike Taulty's Blog

Blogs

Mike Taulty's Blog

Elsewhere

  • ADO.NET Data Services - Concurrency in Action

    Just like for batching, there's a great explanation of how concurrency looks in ADO.NET Data Services up here so this is just a basic example. If I take the "Hello World" style service that I built back here then it does nothing about concurrency checking because, by default, when you build an entity data model with the Entity Framework tooling all of the concurrency options are set to "off". So, if I make a request for a customer and trace it with Fiddler then I see; You can see that I'm requesting the ALFKI customer and I'm just doing it from a browser as it happens. Now, if I go and alter my entity data model a little bit to say that ( purely for instance ) I want to have concurrency checking done on the PostalCode, Country, Region, Address fields of the Customers entity type as in; Then the next time I request that entity I see an ETag header being emitted that contains the value of my concurrency token; and if I was to request lots of customers then I'd see these ETags move into the response data as in; From...
  • ADO.NET Data Services - Batching in Action

    I did a talk on Data Services at DevDays, Amsterdam last week and so I had to take a rather speedy look at batching support as that had been added to the VS 2008 Sp1 bits since the previous preview. Batching is explained up here but here's just a little example of using it. If we take "hello world" style service that we created back in this post and we were to do something like this from the .NET client side code; static void Main( string [] args) { Console.ReadLine(); NorthwindEntities proxy = new NorthwindEntities( new Uri( "https://localhost/SecureSite/Secure/Service.svc" )); foreach (Shippers s in proxy.Shippers) { Console.WriteLine(s.ShipperID); } foreach (Employees e in proxy.Employees) { Console.WriteLine(e.EmployeeID); } Console.ReadLine(); } and if we were to go ahead and trace that traffic with Fiddler then we'd see; That is - we see and HTTP GET request for Shippers and then another one for Employees. Now, if these 2 entity sets are related then we can use the $expand query string operator in order...
  • PDC 2008

    The website is live and it's running with Silverlight :-) http://www.microsoftpdc.com/ If I use this bling as my desktop; http://www.microsoftpdc.com/Social/Bling.aspx where it says "Meet Me in Los Angeles" then does that mean that I get to go to PDC? :-) Note : Just like the PDC's since 2000 it is absolutely my intention to be at PDC 2008 and I will be severely disappointed if I'm held back from attending. In my view, PDC is the single most important event in the Microsoft developer's calendar as it sets the vision for the following years. Don't get me wrong - MIX, TechEd and other events are really important but, for me, there's nothing quite like a PDC for laying out where we're heading.
  • Authenticating with ADO.NET Data Services

    One of the questions that people ask when they've seen ADO.NET Data Services and its facilities for surfacing your data over REST is; So, how do I secure this? There's a number of aspects to securing these systems - off the top of my head we might want some aspects of; Authentication. Authorisation or access control to the operations on the data. Privacy or encryption of the traffic flowing between client and service. Auditing operations that have been performed by the service. Some element of non-repudiability (e.g. user X cannot deny that they deleted record Y). Thinking about authentication - whenever I've been asked "So how do I authenticate?" I've tended to just fall back to a fairly stock answer of "Well, this is all just HTTP and WCF so we just go ahead and use the traditional mechanisms that we've got for authenticating those kinds of things". However, I thought it'd be good to try and explore those options here. What can we actually do? Let's start by building a simple ADO.NET Data Services service and...
  • DevDays, Amsterdam

    I just got back from DevDays, Amsterdam where I spent the last couple of days delivering some sessions on; ADO.NET Entity Framework ( PPTX , PPT , PDF ) ADO.NET Data Services ( PPTX , PPT , PDF ) LINQ to XML ( PPTX , PPT , PDF ) I just want to say thanks to everyone who came along to my sessions. I really enjoyed this conference - one of the best that I've been to in a long time in terms of the atmosphere, the organisation, the venue, the location, the quality of the sessions and the food :-) If you came along, I hope you had a good time and enjoyed the sessions and maybe I'll catch you at a similar event in the future. Thanks a lot to Arie for inviting me along this year.
  • "When Do Queries Execute"

    Julie's got a great post about when stored procedures execute when using LINQ to Entities . It made me think about LINQ to SQL where if I've got something like; using (NorthwindDataContext ctx = new NorthwindDataContext()) { var query = ctx.GetCustomersByCountry( "UK" ); // SQL Happens Here! foreach (Customer c in query) { Console.WriteLine(c.CustomerID ); } } Then we see the same effect as Julie's seeing in LINQ to Entities (note GetCustomersByCountry is a stored procedure) whereas if I've got something like; using (NorthwindDataContext ctx = new NorthwindDataContext()) { var query = ctx.FnGetCustomersByCountry( "UK" ); foreach (Customer c in query) // SQL Happens Here { Console.WriteLine(c.CustomerID ); } } where FnGetCustomersByCountry is a table-valued function then the query is executed at a different point in time. I guess one reason for this is that table-valued functions are composable in LINQ to SQL so I can do something like; using (NorthwindDataContext ctx = new NorthwindDataContext()) { var query ...
  • ADO.NET Data Services and the Missing DataWebKeyAttribute

    If you've hit this post it's probably because you've been reading the Service Pack 1 documentation for Data Services and you've been trying to find the elusive DataWebKeyAttribute that the docs mention. As far as I can tell, it's not there. You need to use DataServiceKey instead and it lives in assembly System.Data.Services.Client under namespace System.Data.Services.Common and you appear to use it like; [DataServiceKey( "FirstName" )] public class Person { public string FirstName { get; set; } public string LastName { get; set; } public int Age { get; set; } } which is slightly different from what you did with the DataWebKeyAttribute .
  • VS 2008 Service Pack 1 - Docs and Installation

    Firstly, the simple stuff. If you've not come across them yet then the documentation for Visual Studio 2008 Service Pack 1 is up here; Home Page Entity Framework Data Services I also find this page extremely useful as I've been asking for it for many months. It lists the supported mapping scenarions for Entity Framework; http://vs2008sp1docs.msdn.microsoft.com/en-us/ms439043.aspx Now, the tricky bit. I had quite a lot of trouble installing Visual Studio 2008 Service Pack 1. Here's what I ended up doing; I followed the instructions very carefully and uninstalled the necessary Hotfixes, Silverlight tools and so on. I also uninstalled the ASP.NET 3.5 Extensions Preview and the Entity Framework preview bits and Expression Blend 2.5 March Preview. Then I installed Sp1. First Time. It failed. I had missed a hotfix which I didn't see listed on the instructions. I uninstalled the hotfix. Second Time. It reported failures on the way through but reported success at the end. I tried a new ADO.NET Entity Framework project...
  • 50 New Silverlight 2 Beta 1 Screencasts

    In my "spare time" I've been recording some screencasts about Silverlight 2 Beta 1 along with my colleague Mike . This managed to reach critical mass in that we've now built up a list of 50 screencasts so I thought it was definitely time to share rather than plough ahead because I imagine that it won't be too long before they all get to be out of date. Things move pretty fast. So, I've built a fairly simple custom application ( in Silverlight 2 Beta 1 of course :-) ) which allows for playing and download of those videos. Note: I've noticed that if you don't have Silverlight 2, the application is currently prompting you to install Silverlight 1. I'll get that fixed but in the meantime, visit here to install Silverlight 2 B1 before launching the application. I'll fix the installation experience. You can find the application by clicking here or by clicking on the picture below. It's also conveniently redirected from http://www.silverlightscreencasts.com ; Just as an aside, the application itself and all of the videos...
  • VS 2008 Sp1 - Want Versus Need

    The Visual Studio 2008 Service Pack 1 dilemma. I want to be able to continue to do Silverlight 2 Beta 1 development. I need to install Visual Studio 2008 Service Pack 1 for Entity Framework and Data Services.
  • VS 2008 Sp1 Beta Links

    Just links.... ScottGu Soma Entity Framework Data Services Download
  • DevDays Amsterdam & Events

    I will be at DevDays in Amsterdam the week after this ( i.e. the 22nd and 23rd May ) doing some sessions on; LINQ to XML ADO.NET Entity Framework ADO.NET Data Services It would be nice to see you there if you're coming along. It's been a little bit of a hectic past few weeks for me in that schedule has involved a lot of travelling around. This week I'm doing; MSDN Roadshow in Glasgow on Tuesday VBUG Leeds on Wednesday MSDN Roadshow in Newcastle on Friday and there's a few more dates in my calendar for June; 12th June - NxtGen Fest 08 In Reading on ADO.NET Entity Framework & Data Services 17th June - VBUG in Bournemouth on Silverlight ( or LINQ, still TBD at this point ) 19th June - ACCU in London on Visual Studio 2008 and looking back across the past few weeks I've been doing; w/c 14th April Silverlight lab with ISVs on the Microsoft Campus, Reading Rehearsals for our MSDN Roadshow ( yes, we do rehearse these things a little before actually doing them ) NxtGen UG in Southampton on ADO.NET Entity Framework...
  • Mocking LINQ to SQL

    Matt Warren has an "interesting" post on how you could hack your way to a mocked implementation of LINQ to SQL - if I had a pound for every time someone's asked me how to do this then I'd have at least 3 pounds :-) Seriously though, there is interest in doing this kind of thing and it's a good starting place if you're inclined to head down this route.
    Filed under: ,
  • Silverlight - Healthcare Demo

    Interesting demonstration app up here; http://www.mscui.net/PatientJourneyDemonstrator/ put together by some of the MCS guys in the UK as far as I know. The terminology is a bit weird ( "Patient Journey?" ) but the app's quite cool as a playpen for Silverlight.
    Filed under:
  • "I Didn't Do It"

    Not guilty . Never touched it. Absolutely nothing to do with me although I did receive some slightly strongly worded mails from some internal IT folks looking for the real culprit :-)
    Filed under:
1 2 Next >