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

    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

    An analogy: Good UIs and Fluent APIs

    • 5 Comments
    Background A while back I was writing a web app to try the Entity Framework and MVC together. I knew the pain points would probably be around Foreign Keys, or at least the lack of them in .NET 3.5 SP1 (FKs are now available by default in .NET 4...
  • Meta-Me

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

    • 5 Comments
    Okay so we've got to the interesting bit at last. We've hooked up our extension method, we've got a query for filtering the records we are updating, we've got a map from object Properties to database Columns. So now comes the interesting bit... ...
  • Meta-Me

    Associations with Payloads - part Deux

    • 5 Comments
    Okay so the 'cat is out of the bag' you CAN do associations with Payloads... Sort of . Now for an explanation of what I meant by 'Sort of'. Let's dream a little and imagine how it might work in an ideal world. Imagine something like this: Product p =...
  • Meta-Me

    Associations with Payloads - closing the loop

    • 5 Comments
    I'm assuming you've read part 1 and part 2 , if not why not? Just kidding, they will make this post a little easier to understand though. I'm going to show you how to create a read-only association with a Payload. Okay so imagine you have this model...
  • 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

    Ordering of Commands – What do you think?

    • 5 Comments
    Some of our customers write code like this: ctx.AddToCustomers(customer); ctx.AddToProducts(product1); ctx.AddToProducts(product2); And expect the Entity Framework to issue 3 insert commands in the same order. Today the EF doesn’t preserve this sort of...
  • Meta-Me

    Tip 55 - How to extend an IQueryable by wrapping it.

    • 5 Comments
    Over the last couple of years I’ve found myself in lots of situations where I’ve wanted to get ‘under the hood’ and see what is happening inside an IQueryable, but I haven’t had an easy solution, at least until now. Getting down and dirty like this...
  • 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 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

    CQRS with OData and Actions?

    • 5 Comments
    I love the Actions feature in OData – which is hardly surprising given I was one of its designers.  Here’s the main reason why I love it: Actions allow you move from a CRUD architecture style, where you query and modify data using the same model...
  • Meta-Me

    Tip 41 – How to execute T-SQL directly against the database

    • 4 Comments
    Sometimes you’ll find you need to issue a query or command that the Entity Framework can’t support. In fact this problem is common to most ORMs, which is why so many of them have a backdoor to the database. The Entity Framework has a backdoor too… .NET...
  • Meta-Me

    Creating a Data Service Provider – Part 5 - Query

    • 4 Comments
    In Part 4 of our series showing how to implement a Custom Data Service Provider we hooked up an incomplete implementation of IDataServiceQueryProvider , just enough to get the ServiceDocument and $metadata working. In this part we’ll get query working...
  • Meta-Me

    Tip 49 – How to find your Data Service bug

    • 4 Comments
    I’ve been playing around with creating a custom Astoria Data Service Provider , aka DSP, for a while now. So far I’d managed to get my metadata all setup, so browsing to $metadata works great. I’d got a few simple queries work. Basically everything was...
  • 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

    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 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

    Statement of Intent

    • 4 Comments
    This blog has been a little quiet for a while now. With good reason though. I've been doing the hard yards answering questions on the Entity Framework forum . To do so I had to ask literally hundreds of questions of the rest of the Entity Framework team...
  • Meta-Me

    Real world App - Part 1 - Choosing an Application

    • 4 Comments
    Okay so it has been a while since I posted my Statement of Intent . Time to get on with things. The main problem has been trying to come up with a good application. I gave myself three key requirements: Well suited to the web. Ability to...
  • Meta-Me

    Fantasy Soccer - part 3 - Unit of Measure

    • 4 Comments
    Today I spent a bit of time working on the data model for my fantasy soccer application. I don't want to talk about the actual model today though, because I'm not really ready. What I want to do is talk about a problem that occurred to me, namely...
  • Meta-Me

    Using a random model at runtime

    • 4 Comments
    In my last post I hinted that using the Entity Frameworks Value layer and Metadata allows you to work against any Entity Data Model in a loosely coupled way. Let’s see how… So let’s imagine you are working against the Value layer. With code something...
  • 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

    ObjectQuery<T>.ToTraceString() and possibilities...

    • 4 Comments
    So in Beta3 of the EntityFramework (due out very soon) the team added a new function to ObjectQuery <T> that allows you to get the native Query that would be evaluated if you enumerated. I.e. if you are using the System.Data.SqlClient that would...
  • Meta-Me

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

    • 4 Comments
    One of the current limitations of the Entity Framework, is that in order to modify an entity you have to first bring it into memory. Now in most scenarios this is just fine. There are however some bulk update cases where performance suffers somewhat....
  • 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...
Page 3 of 7 (151 items) 12345»