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 48 – How to host a Data Service in WCF

    • 1 Comments
    Every wonder if you can host an Astoria Data Service in WCF? Well turns out the answer is yes, in fact once you’ve got your references set up etc it is pretty easy. Step 1 – Setting up your project Here is what my working project looks like: In this example...
  • Meta-Me

    Tip 21 – How to use the Single() operator – EF 4.0 only

    • 3 Comments
    This is 21st post in my ongoing series of Entity Framework Tips , and the first that is specific to EF 4.0. Entity Framework 4.0 Beta 1 As you’ve probably heard VS 2010 Beta 1 is now available to subscribers which means some of you can get your hands...
  • Meta-Me

    Tip 20 – How to deal with Fixed Length Keys

    • 6 Comments
    This is 20th post in my ongoing series of Entity Framework Tips . Fixed Length Field Padding: If you have an fixed length column in the database, for example something like NCHAR(10) when you do an insert, padding happens automatically. So for example...
  • 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 6 - How and when to use eager loading

    • 5 Comments
    When should you use eager loading? Usually in your application you know what you are going to "do" with an entity once you have retrieved it. For example if you retrieve an order so you can re-print it for a customer, you know that the re-print would...
  • Meta-Me

    Tip 5 - How to restrict the types returned from an EF Query.

    • 9 Comments
    Imagine you have a model that looks like this: How do you query for just Cars? This is where OfType<SubType>() comes in. You write something like this: var onlyCars = from car in ctx.Vehicles.OfType< Car >() select car; And...
  • Meta-Me

    Hydrating a DataTable from an EntityDataReader - Part 2

    • 1 Comments
    See yesterday's post for some context... So we can't rely on EntityDataReader . GetSchemaTable() and a DataAdapter to do the filling of our DataTable for us. We have to do it ourselves. As with any problem the first step is to define the steps:...
  • Meta-Me

    Tip 36 – How to Construct by Query

    • 6 Comments
    While writing my tips series and writing EF controllers for MVC I found that I regularly wanted to create and attach a stub entity . Unfortunately it isn’t quite that simple, you have to make sure the entity isn’t already attached first, otherwise...
  • Meta-Me

    Associations with Payloads

    • 10 Comments
    Those of you who know what I am talking about will probably also know that we have been saying publicly that the Entity Framework doesn't support them. Now for those who don't know what an association with a payload is, imagine something like: Order...
  • 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

    Maybe I'm just a little slow...

    • 9 Comments
    But I only just realized that extension methods are cool for avoiding NullReferenceExceptions . We all know that if you have something like this: LicensePlate licensePlate = null ; Car car = licensePlate.Car; It will throw a NullReferenceException...
  • Meta-Me

    DefiningQuery versus QueryView

    • 2 Comments
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 ...
  • Meta-Me

    LINQ to Objects and Buffer<T>

    • 3 Comments
    I was debugging a problem a couple of days ago, when I learned something interesting. I had some code that looked like this: foreach(Employee e in manager.Manages) { … } The manager.Manages property returned a custom implementation of ICollection<Employee>...
  • Meta-Me

    Tip 31 – How to compose L2O and L2E queries

    • 2 Comments
    Imagine you want to write a query like this: var possibleBuyers= from p in ctx.People where p.Address.City == “Sammamish” && InMarketForAHouse(p) select p; Now theoretically this is possible so long as there is a SQL translation for InMarketForAHouse...
  • Meta-Me

    A silly C# trick from the trenches

    • 7 Comments
    UPDATE: as Joe rightly points out in the comments (thanks Joe) when you try to pass a Func<T,V> to a method expecting Action<T> using lambda syntax it doesn't fail. Somehow the compiler must realize there is no match for Func<T,V> and...
  • Meta-Me

    Code-Only best practices

    • 3 Comments
    There have been lots of posts on the EFDesign blog talking about how the features in Code Only have evolved. But very little covering what we think will be the best way to write the code. You may have seen code like this: var prodConf = builder.Entity<Product>...
  • Meta-Me

    Tip 39 – How to set overlapping Relationships – EF 4.0 only

    • 1 Comments
    Scenario: In EF 4 we have FK relationships , available for the first time in .NET 4.0 Beta 2, so it is now possible to have a model something like this: public class Division { public int DivisionID {get;set} // Primary Key public string Name {get;set;...
  • Meta-Me

    Tip 4 - Conceptual Schema Definition Language Rules

    • 2 Comments
    The first version of the Entity Framework was released a while back ago now with .NET 3.5 SP1. One of the most glaring holes in the Entity Framework documentation was the lack of a formal document describing the Conceptual Schema Definition Language...
  • Meta-Me

    State vs Statement of Intent

    • 5 Comments
    Well I went to Vegas for Dev Connections. What an experience. Never been there before, but for first two days I was too worried about my two talks to take much in. My first talk was Entity Framework in a world of Services and Processes . My old...
  • Meta-Me

    Side effects of first class Associations

    • 9 Comments
    You've probably all heard someone say that Entity Data Model (EDM) and more specifically the Entity Framework (EF) treat associations as first class concepts. This sentence, seems reasonably benign, but it has a profound effect on the Entity Framework...
  • Meta-Me

    Tip 29 – How to avoid LazyLoad or Load() reader issues

    • 1 Comments
    If you have code that looks like this: var results = from c in ctx.Customers where c.SalesPerson.EmailAddress == “…” select c; foreach(var customer in results) { Console.WriteLine(customer.Name); if (IsInteresting(customer)) { customer.Orders.Load...
  • Meta-Me

    All the power at your disposal

    • 3 Comments
    I invite you to take a look at this forum post from 'Benys' It illustrates the power of the Entity Framework's mapping capabilities + partial classes. The short answer to a lot of "Does the EF support ... ?" type questions is often no. Often however the...
  • Meta-Me

    Is hiding lower level APIs bad?

    • 6 Comments
    There are many good arguments for hiding away the lower layers in your stack – essentially the building blocks upon which your public API is built - however the ‘ we don’t have the time and resources to test that layer completely ’ argument seems a little...
  • Meta-Me

    Software Development Meme

    • 1 Comments
    So thanks Danny for giving me a ping... it's been a while since I participated in one of these blog chain letters. Funny really because now I am a Program Manager, I'm not a real developer anymore ;) How old were you when you first started programming...
  • Meta-Me

    Tip 47 – How fix-up can make it hard to change relationships

    • 2 Comments
    Problem: Take this code: Category oldCategory = ctx.Categories .Include("Products") .First(c => c.Name == "Drink"); Category newCategory = new Category {Name = "Beverage"}; foreach(Product product in oldCategory.Products) { newCategory.Products...
Page 4 of 7 (151 items) «23456»