ST4bby is a T4 template that will generate POCO's (Plain Old CLR Objects) from your database tables and columns. It doesn't rely on any particular ORM but can be used in conjunction with them, including but not limited to:
Here is all you need to do:
After that, you can continue to run the T4 template as you update the database, or you can delete the T4 templates and keep the POCO's.
Currently there are no major limitations, but there may be some issues surrounding decimal support. Decimals are supported, but the differences in the lengths of the SQL Server equivalent datatypes may cause issues. If you're storing "big" numbers, make sure they don't get truncated when going into SQL Server.
Only a few Data Annotation attributes are currently supported (Key, Required, and StringLength). Ideally we will support all related validation attributes (if there are in fact more).
None!
Please don't be afraid to contribute, but because of the sensitive nature of T4 here are a some guidelines:
John Bubriski ([email protected])
Jared Barboza ([email protected])
You can download this project in either zip or tar formats.
You can also clone the project with Git by running:
$ git clone git://github.com/jbubriski/ST4bby
.............................................................................................................................. ............................ ....:.:... ..................................................................................... ....................... ::::ccccccccccccccc. ................. .. .:ccccccc:.................................................. ......................:::.cccccc:. .:cccccc ............ ::..ccccccccccccccc .............................................. ................... :::::cccc .cccc:......... :::.ccccc: :ccccc ............................................ ...................:::.cccc. :oc :cccc ...... ::::cccc cccc ........................................... ................. :::::ccc @@@@@@@8c :ccccccccccccccccc. .O@@@c .ccc .......................................... .................::::.ccc: .@@@@@@@@@@@@o ................ c@@@@@@@@@ :cc:.......................................... .................::::.ccc. 8@@@@@@ @@@@ c@@@@@@@ @O .ccc ......................................... .................::::.ccc: C@@@@@@88@@@@8 :@@@@@@@@@@@C :cc: ......................................... ................. :::::ccc O@@@@@@@@@@8 o@@@@@@@@@O ccc .......................................... ...................::::cccc. C@@@@@@O. cccccccccccccccccccc. c8@@@@o .ccc............................................ ................... ::::ccccc. :cccc:cccccccccccccc:ccc: :cccc ............................................ .................... .::::ccccccc:....:cccccc:.:ccccccccccccc::.:cccccccccccccc .............................................. ....................... .:::cccccccccccccc:.::::cccccccccccccc . .:cccc:. ................................................. ..................................... .:::::::.cccccccccccccc................................................................. ...................................... ::::::::.cccccccccccccc ............................................................... ...................................... :::::::: cccccccccccccc .......................................................oO888c.. .............................. ..... :::::::: cccccccccccccc ...................................................:C88O8888c.. .......................... .::::::::::.::::::::.cccccccccccccc...........................................:: ...:C888888888C... .........................:::::::::::.. ::::::::::cccccccccccccc .........................................: .:oO88CO888888O.... ...................... :::::::::.:cccc:::::::::::.cccccccccccccc ........................................:o888OO88888888O:.... ......................::::::::.ccccccc:::::::::::::cccccccccccccc......................................oO88CO8888888888O:..... ................... ::::::::.ccccc......:::::::::::cooooc....:cc ...................................:O88OO888888888888O....... ..... ..:::::::::::::::::::.ccccc.... . ::::::OC88C888888. .....................................o88OC88888888888888c........ .... :::.:::::::::::::::::.cccccc.... . ::::coOCOOCOOOOOC... ..................................cO8OCO88888888888888C.......... .... ::::::.::::::::::::::ccccccc:.... ::::::Oo88C88COOc...................................:O88CO888888888888888o............ .... ::::::::.........:::ccccccccccccccc::::::::::ccccccccc:.............................:C88CO888888888888888Oc.............. .... .ccccc:.::ccccccccccccccccccccccccc.::::::::.ccccccccc......... . :ccc::c... cO8OCO888888O8888888Oc................. ... ccccccccc.ccccccccccccccccccccccccccc.::::::.ccccccccc ... :ccccccccc:.cc.:.:.:::C8888C8888888888888Oc: .................. .. ccc.........:ccccc:::.:.:::cccccccccccccc....:.:.... ...ccccccccccccccc..::::.::o8888888O888O8OCc.. . ................... . cc:....... ...... ..:ccccccccccccccccccccc:ccccc:cc.. . cccccccccccccccccc ::::: .:o888888OCo:....... : ................... .. ccc ..... ................. . ......:::::.:::: . .... cccccccccccccccccccc.:::::..:::: ............. : ................... ... cccc:... ............... ......... .......... .......ccccccccccccccccccccc.:::::::::::: ............ . ................... ...::.:cccc:......................... .......... ........cccccccccccccc.:c:..c::::.:.. . . ......... : ................ .. ::::::::::cccccc. ................ .......... .........cccccccccccc.cccccc.... . . . ........... ...::::: ................ .. :::::::::cccccc:cccccccc:.................... .........cccccccccccc::ccc.ccccc................ .............. ........... .. ::::::::.cccccc.ccccccccccccccccccccc::.... ...... .ccccc.ccccc:.c.ccccccc:cc........ ........................ ...... ..:::::::::.cccccc:cccccccccccccccccccccc.ccc........... .::..ccc:cccccc...:cccc::c...... ................................ ... ..::::::::::ccccccccccccccccccccccccc::.:ccc:........... .... :ccc::cccc:c: ...... ...................................... . :::::::::ccccccc::::......:::ccccccccccccc ........... . . .. .c:cccc.cc:...... ........................................