tags:

views:

168

answers:

1

Hi, Is the code gen tool sqlmetal only a mapper to linq to sql?

I'm looking for something that will create common CRUD operations also like:

GetUserByID UpdateUserByID InsertUser GetAllUsers

etc.

+1  A: 

Yeah, SQLMetal only creates the mapping file. Most CRUD operations are trivial, though, once you've set up the mappings in LINQ to SQL. Generally, you wouldn't code with methods like this when using LINQ to SQL... For example, GetUserByID would just be:

using (var dc = new YourDataContext) {
     User u = dc.User.Single(u => u.ID == whateverID);
}

Seems more verbose for really trivial operations, but once you do more complex operations, it gets really powerful, really fast.

Dave Markle