markrendle / Simple.Data

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

Modified method ToOrderByDirective to use given db schema instead of default. #399

Open Brzeczunio opened 6 years ago

Brzeczunio commented 6 years ago

When we have database with 2 tables like: ProcesAndOperation.Processes, dbo.Processes and we want take records from ProcesAndOperation.Processes, with order by ProcesAndOperation.Processes.Id desc, we will catch error. It will be caused by the sql query "select ProcesAndOperation.Processes.Id, ProcesAndOperation.Processes.Comments from ProcesAndOperation.Processes order by dbo.Processes.Id desc". Problem is in method GetName() - it takes only table name Processes without database schema. This fix is working for me.