Entity structure has the concept of "First Model", which generates a database model from your model, hence the name.
You can read about it here: http://msdn.microsoft.com/en-us/data/ff830362
However, my personal favorite when it comes to object relational maps is NHibernate with the addition of Fluent NHibernate. They have a concept in which you work with a domain model, not a data model, and you use conventions to manage your mappings. This is pretty neat. You can start with some pretty good examples by looking at this code here: https://github.com/sharparchitecture/Northwind/tree/master/app
Linq2Sql is too limited for the case you are talking about. And he does not have the ability to generate data models from code. In fact, Linq2Sql works the other way around - it generates a set of classes from your data model, just as Entity Framework can.
Neither Linq 2 SQL nor Entity Framework commit anything until you explicitly decide to do so. They both have the concept of an object context that tracks all changes made. When you call Save, they convert these changes to SQL, which is then executed in the database.
source share