Blog - About

About Meta-Me

Hi,

My name is Alex James, a Program Manager working on the Data Services team at Microsoft.

My current focus is OData and improving the usability of Data Services, both client and server side.

Previously I worked on the Entity Framework team where I helped create EF 4.0, and CodeOnly.

I'm also really passionate about Metadata, hence the name Meta-me.

Cheers
Alex

I waffle and twitter as adjames

  • Meta-Me

    Parsing OData Paths, $select and $expand using the ODataUriParser

    • 2 Comments
    UPDATE : This post was updated on May 29th 2013 to reflect changes to simplify the SelectExpandClause API between 5.5 beta and 5.5 RTM Release, the biggest change involved merging Select and Expand into SelectedItems. The ODataUriParser is continuing...
  • Meta-Me

    Tip 45 – How to swap EF metadata at runtime.

    • 3 Comments
    Background By default the Entity Framework embeds its metadata inside your assembly as a resource. It also puts a connection string in the App or Web Config that references those resources something like this: <add name="BloggingEntities" connectionString...
  • Meta-Me

    Tip 10 - How to understand Entity Framework jargon

    • 4 Comments
    The Entity Framework is pretty big, so when the Entity Framework team talks about things internally we tend to use jargon to increase communication 'bandwidth'. Unfortunately sometimes we let this Jargon slip into our APIs and communication. Now...
  • Meta-Me

    Tip 54 – How to improve performance using Statement Expressions

    • 2 Comments
    Background: While writing the update post in my Data Service Provider series I ended up writing this block of reflection code to copy properties values from one object to another: foreach (var prop in resourceType .Properties .Where(p => (p.Kind &...
  • Meta-Me

    Tip 3 - How to get started with T4

    • 11 Comments
    So if you've been reading the Entity Framework Design Blog you will have heard us talk about T4 . It is a technology that ships with Visual Studio 2008 (and 2005 as a separate download). In .NET 4.0 the Entity Framework is leverage T4 to help with...
  • Meta-Me

    Rolling your own SQL Update on top of the Entity Framework - Part 2

    • 3 Comments
    Okay so it has taken me a while to get to the second part of this post... but as they say better late than never. As I've said before when designing this sort of API, I always like to start with the end in mind... this is what I want the Update() method...
  • Meta-Me

    Tip 25 – How to Get Entities by key the easy way

    • 5 Comments
    Sometimes rather than writing this: var customer = ctx.Customers.First(c => c.ID == 5); You would rather write something like this: var customer = ctx.Customers.GetCustomerById(5); In .NET 4.0 this would be trivial to do by modifying the...
  • Meta-Me

    CommandBehavior.SequentialAccess

    • 4 Comments
    So why does this: EntityDataReader reader = command.ExecuteReader(); Throw an exception? Well it is to-do with correctness and setting expectations. First things first, this is what you should do: EntityDataReader reader = command.ExecuteReader...
  • Meta-Me

    I never knew: C# method overloads can return different types

    • 4 Comments
    I came to C# from Java, which I’m pretty sure doesn’t (or maybe didn't) allow this, so I was super surprised today when I learnt that C# method overloads can have different return types. So this class is completely valid: public class Foo { public...
  • Meta-Me

    Tip 40 – How to materialize presentation models via L2E

    • 5 Comments
    Problem: Imagine that you have these entities public class Product { public int ID { get; set; } public string Name { get; set; } public virtual Category Category { get; set; } } public class Category { public int ID { get; set; } public string Name ...
  • Meta-Me

    Tip 15 - How to avoid loading unnecessary Properties

    • 4 Comments
    UPDATE: Made a couple of important corrections re-which Original Values are required. Problem: Imagine if you query blog posts: var myPosts = from post in ctx.Posts orderby post.Created descending select post; Just so you can output the post...
  • Meta-Me

    Tip 27 – How to Implement BeforeSave Validation

    • 4 Comments
    It is common to want to validate that your entities are ‘valid’ before you save them to the database. A naive form of validation might be to try to ensure that your entities are ‘valid’ before you add them to the context, but this doesn’t help you if...
  • Meta-Me

    Tip 52 – How to re-use Types with the Data Services client

    • 2 Comments
    By default when you add a Data Service Service Reference you get automatic code-generation, which produces a strongly typed DataServiceContext and classes for all your ResourceTypes. You can have a look at this generated code if you ‘show all files...
  • Meta-Me

    Tip 35 – How to write OfTypeOnly<TEntity>()

    • 4 Comments
    If you write a LINQ to Entities query like this: var results = from c in ctx.Vehicles.OfType<Car>() select c; It will bring back, Cars and any type that derives from Car, like say SportCar or SUV. If you just want Cars and you don’t want...
  • Meta-Me

    Rolling your own SQL Update on-top of the Entity Framework - Part 3

    • 4 Comments
    Okay, okay, okay... yes I know this is the slowest moving series in the history of blogging (sorry Roger J). Now, when a blog post starts like that, you would probably expect the next sentence to begin with "But" or "However", not this time though...
  • Meta-Me

    Tip 51 – How to load EF metadata from arbitrary streams

    • 2 Comments
    In Tip 45 I showed you how to build a connection string at runtime, which is pretty nifty. The problem with that was that it relies on having metadata files (.csdl .ssdl and .msl) on local disk. But what if they live on a web-server or something...
  • Meta-Me

    Tip 42 – How to create a dynamic model using Code-Only

    • 5 Comments
    Background: When we give examples of how to use Code-Only we always start with a strongly typed Context derived from ObjectContext . This class is used to bootstrap the model. For example this (property bodies omitted for simplicity sake): public...
  • Meta-Me

    Tip 11 – How to avoid Relationship Span

    • 5 Comments
    Background and Motivation: In my last post on EF Jargon I introduced the concept of Relationship Span. If you remember Relationship Span is basically responsible for compensating for the lack of Foreign Key properties* in your Entity. Relationship...
  • Meta-Me

    Hydrating a DataTable from an EntityDataReader - part 1

    • 3 Comments
    Okay so about 5 posts back I promised: "...At this point we have an enumeration of all EntitySet s available. In the next post I explain how we can use that…" Well better late than never... If you remember last time I showed you this piece of...
  • Meta-Me

    Tip 53 – How to debug EF POCO mapping issues

    • 2 Comments
    If you are trying to use POCO classes in EF 4.0, it is relatively easy to run into problems with the mapping from your model to your CLR classes. If you get any nasty problems here, the best way to get to the bottom of things is to try to explicitly...
  • Meta-Me

    Tip 46 – How to exclude a property using Code-Only

    • 1 Comments
    This time a real simple one prompted by this question on StackOverflow. Problem: If you tell the Entity Framework about this class using Code-Only, by default every property becomes part of Entity, and as a result stored in the database. Usually this...
  • Meta-Me

    Tip 32 – How to create a database from SSDL – EF 4 only

    • 0 Comments
    We recently released a CTP that extends EF 4 Beta 1 which included Code Only. You can read more about Code Only here , here and here . If you look at the walkthroughs for Code Only you will see code that looks something like this: // Create a builder...
  • Meta-Me

    Tip 17 – How to do one step updates with AttachAsModified(..)

    • 2 Comments
    Background: In Tip 13 - How to Attach the easy way I showed you how to ‘establish’ the EntitySet for a particular CLR Type so you could Attach it. But in all the tips so far the same basic pattern is used: Attach the original version of the Entity Modify...
  • Meta-Me

    TechEd 2010 Videos

    • 2 Comments
    If you didn't get to TechEd - no problem - videos of all the sessions are available here . Including my Best Practices: Creating an OData Service using WCF Data Services session . If you watch that video and want to follow try it out - you can download...
  • Meta-Me

    Tip 2 - Entity Framework Books

    • 1 Comments
    Question: Where do I find in depth books on the Entity Framework? Answer: One of the benefits of being on a product team a Microsoft is you get authors who want you to review their books. So far to date I've have had 3 different authors send...
Page 3 of 7 (151 items) 12345»