markrendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 303 forks source link

CreateFindOneDelegate and CreateGetDelegate do not receive schema information #225

Closed object closed 11 years ago

object commented 11 years ago

If I add prefix to a table name for FindAll commands, then the prefix is passed as schema, e.g.:

db.My.Users.FindAll(...)

So the adapter will get the chance to handle "My" prefix.

But for FindOne and Get commands the schema information is lost by the time CreateFindOneDelegate or CreateGetDelegate are called. Because of that calls like db.My.Users.Get() and db.My.Users.FindById() are identical to db.Users.Get() and db.Users.FindById() and the adapter will only receive "Users" part, "My" will be lost.

This behavior creates inconsistency between FindAll and FindOne/Get implementation, making it impossible for adapters to receive and properly handle schema passed as table prefix.

markrendle commented 11 years ago

Oops. I was just about to push a new release, but I'll delay until tomorrow morning and get this fixed.

markrendle commented 11 years ago

Schema is now passed to CreateGetDelegate as "schema.table" in the tableName parameter.

It was already being passed to CreateFindOneDelegate, though.