Entity Framework - using stored proc and mapping properties
===

I have my framework setup with code first with a BaseEntity type that simply contains Id and a Name properties (all my db tables have at least these two fields). The problem is that the db was written before we implemented EF so many of the columnnames in the db do not match this nice Id/Name convention (for example there might be CustomerId and CustomerName etc). Now as far basic CRUD operations go this works fine because I simply do this in my mappings:

    this.HasKey(t => t.Id).Property(t => t.Id).HasColumnName("CustomerId");

and it correctly maps from one to another and all is good

However, we also have some complex database logic that can only be encapsulated in stored procedures so in my ObjectContext I have a generic method for invoking sprocs that returns IList<TEntity> and allows you to pass in the name of the proc to invoke and any params it requires, it then goes to the underlying Database object on the ObjectContext to make the call. This works great for classes where the property names in the poco match those in the db, but if they do not, it ignores any mapping I have setup for that object (see above) and I get an error like this:

    The data reader is incompatible with the specified 'SomeNamespace.Customer'. 
    A member of the type, 'Id', does not have a corresponding column in the data 
    reader with the same name.

Is there any clean way to work around this or to properly instruct it to map it correctly on the underlying datareader?

thanks
