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

    OData support in ASP.NET Web API

    • 52 Comments
    UPDATE 2 @1:21 pm on 16th August (PST): There is an updated version of the nuget package that resolves the previous dependency issues. Oh and my comments are now working again. UPDATE 1 @10:00 am on 16th August (PST): If you’ve tried using the...
  • Meta-Me

    Tip 8 - How to write 'WHERE IN' style queries using LINQ to Entities

    • 28 Comments
    Imagine if you have a table of People and you want to retrieve only those whose the Firstname is in a list of interesting firstnames. This is trivial in SQL, you write something like this: SELECT * FROM People WHERE Firstname IN ('Alex', 'Colin', ...
  • Meta-Me

    Tips and Tricks

    • 25 Comments
    Hopefully if you're reading this you've noticed that I've started a series of Tips recently. The tips will mostly apply to Entity Framework or Data Services. Seeing as I expect to have a lots of tips, it probably makes sense to have some sort of...
  • Meta-Me

    Tip 23 – How to fake Enums in EF 4

    • 51 Comments
    As of right now Enums are not in EF4. Now we will be listening to your feedback about Beta1, and making some adjustments, so you never know, but at the moment it doesn’t look like they will be supported. Yesterday though I came up with a workaround...
  • Meta-Me

    Tip 33 – How cascade delete really works in EF

    • 6 Comments
    Imagine that in your database you have a cascade delete on an FK relationship. Something like this: Here the Delete Rule says that when a Category is deleted all the related Products should be deleted too. If you generate an EF model from this database...
  • Meta-Me

    Custom Data Service Providers

    • 14 Comments
    Introduction Data Services sits above a Data Service Provider, which is responsible for interacting with the underlying Data Source on behalf of the Data Service. Data Services ships with some internal providers, and makes it possible for you to...
  • Meta-Me

    Tip 19 – How to use Optimistic Concurrency with the Entity Framework

    • 9 Comments
    This is the 19th post in my ongoing series of Entity Framework Tips . Background: If you have a table with a timestamp column, and you reverse engineer an Entity from that table, you will end up with a Binary property in your entity (in my example...
  • Meta-Me

    Tip 26 – How to avoid database queries using Stub Entities

    • 21 Comments
    What are Stub Entities? A stub entity is a partially populated entity that stands in for the real thing. For example this: Category c = new Category {ID = 5}; is a stub entity. It has only the ID populated, which indicates this is a stub...
  • Meta-Me

    How do I do design?

    • 2 Comments
    For a while now I've been thinking that the best way to get better at API & protocol design is to try to articulate how you do design. Articulating your thought process has a number of significant benefits: Once you know your approach you can critique...
  • Meta-Me

    Tip 22 - How to make Include really Include

    • 22 Comments
    This is 22nd post in my ongoing series of Entity Framework Tips . If you want to do eager loading with the Entity Framework it is generally really easy, you simply write something like this: var results = from post in ctx.Posts.Include(“Comments”)...
  • Meta-Me

    Tip 14 - How to cache Entity Framework Reference Data

    • 13 Comments
    Scenario: In order to make applications perform it makes a lot of sense to cache commonly used reference data. Good examples of reference data include things like States, Countries, Departments etc. Generally you want to have this data readily at hand...
  • 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

    Tip 9 – How to delete an object without retrieving it

    • 16 Comments
    Problem The most common way to delete an Entity in the Entity Framework is to pull the Entity you want to delete into the context and then delete it like this: // Find a category by ID by // TRIVIA: in .NET 4.0 you can use .Single() // which will throw...
  • Meta-Me

    OData in WebAPI – Microsoft ASP.NET Web API OData 0.2.0-alpha release

    • 30 Comments
    Since my last set of blog posts on OData support in WebAPI (see parts 1 & 2 ) we’ve been busy adding support for Server Driven Paging, Inheritance and OData Actions. Our latest alpha release on Nuget has preview level support for these features. Lets...
  • Meta-Me

    Tip 18 – How to decide on a lifetime for your ObjectContext

    • 12 Comments
    One of the most common questions we get is how long should an ObjectContext should live. Options often cited include one per: Function Form Thread Application Plenty of people are asking these types of questions, case in point here is a question on Stackflow...
  • Meta-Me

    Tip 24 – How to get the ObjectContext from an Entity

    • 7 Comments
    Customers often ask how to get from an Entity back to the ObjectContext . Now generally we don’t recommend trying this. But sometimes you really need a way to get to the ObjectContext . For example if you are in method and all you have is the Entity...
  • Meta-Me

    Tip 12 - How to choose an Inheritance Strategy

    • 13 Comments
    What strategies does the Entity Framework support? The Entity Framework supports 3 primary inheritance strategies: Table Per Hierarchy (TPH): In TPH, all data for a type hierarchy is stored in one table, and there is a discriminator column that is used...
  • Meta-Me

    Tip 34 – How to work with Updatable Views

    • 16 Comments
    UPDATE: thanks Zeeshan for pointing out that by default only non-nullable columns end up in the key for view backed entities. Imagine this situation, you have a view in your database, and it is updatable. Next you decide to use this view with the Entity...
  • 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

    SaveChanges(false)

    • 6 Comments
    Most of the time the Entity Framework (EF) can manage transactions for you. Every time you Add an Entity, Delete an Entity, Change an Entity, Create a Relationship or Delete a Relationship in your .NET code, these changes are remembered by the EF, and...
  • Meta-Me

    Creating a Data Service Provider – Part 3 - IDataServiceMetadataProvider

    • 10 Comments
    UPDATE: I’ve made a few updates to the code / write-up to reflect refactors I’ve made as I’ve implemented more of the interfaces. This is Part 3 of my ongoing series on Creating a Data Service Provider , and in this post we’ll look at how to implement...
  • Meta-Me

    Creating a Data Service Provider – Part 2 – IServiceProvider & DataSources

    • 2 Comments
    To create a read-only Data Service Provider (or DSP) you need to implement two Data Services interfaces: IDataServiceMetadataProvider to provide the metadata and IDataServiceQueryProvider to handle the queries. But first Data Services needs a way to...
  • Meta-Me

    Tip 1 - How to sort Relationships in Entity Framework

    • 6 Comments
    Question: One of the questions you often see in the Entity Framework Forums is around sorting related items. For example imagine if you want to query customers, and return only those that have accounts more than 30 days in arrears, and at the same...
  • Meta-Me

    Creating a Data Service Provider – Part 1 - Intro

    • 1 Comments
    One of the the coolest things about Data Services is its provider model. Any data-source can be exposed as an OData Data Service simply by implementing a few interfaces. SharePoint 2010 implements these interfaces to expose list data, and you can too...
  • Meta-Me

    Web API [Queryable] current support and tentative roadmap

    • 7 Comments
    The recent preview release of OData support in Web API is very exciting (see the new nuget package and codeplex project ). For the most part it is compatible with the previous [Queryable] support because it supports the same OData query options. That...
Page 1 of 7 (151 items) 12345»