I want to be able to take a LINQ statement like this.
var User = from u in Users
where u.UserID == 7
select u.UserName;
And have it generate SQL like this.
SELECT UserName FROM Users WHERE Users.UserID = 7
I know LINQ TO SQL does this but I don’t want all that added xml mapping and generated code.
Obviously this is possible since LINQ TO SQL does it but how does it do it?
Update
Other reason why I don’t want to use LINQ to SQL is because I want to use it for PostgreSQL.
Right now there doesn’t seem to be an open source production ready LINQ to PostgreSQL library.
So since this is a new project I’m going to use MongoDB with MongoDB-CSharp as my LINQ driver.
It does everything I need it too with the added benefit of not having to worry about schemas and stored procedures.