Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
You can autogenerate your POCOs directly from your database using this T4 Template
You can also install it using Nuget
You specify a connection string (from web.config or app.config) and set a namespace and the template will generate a class per table with necessary attributes. Primary Key fields are marked with the [Key] attribute. The classes for the table names are converted to singular form (Users becomes User) and the [Table("Name")] attribute is applied.
The class and each property is virtual so you can override them in your own classes to add things like data annotations.
Check out the sample website project for example usage.