主角不是Enterprise Library, 而是.NetTiers, 它是一个开源的ORM结合Enterprise Library的代码生成工具, 使用CodeSmith编写, 自动生成ORM和单元测试代码, 小兵看完它的演示视频后, 称赞不而, CodeSmith可以如此强大, Enterprise Library应用可以如此快捷! 下面是它的一些介绍和资料, 有兴趣的朋友可以看看.
The .Net data tiers generator
.NetTiers are CodeSmith templates for object-relational mapping that takes an existing SQLServer database and automatically generates a personnalized Data Tiers application block to use in your .Net applications.
Core features include:
- Generates ready to use Visual Studio projects and solution.
- Fully integrate with entreprise library application blocks architecture. Shipped with it's own plugin, so you can configure your application directly from the entlib configuration console.
- Generate the business objects (called entities) with a 1:1 mapping ( an entity for each table, with a property for each column).
- Serializable
- trigger events
- Implements an IEntity interface, which contains the columns that are present in every table
- Specific support for enums.
- Generate Data Access Layer Components (DALC) for tables and views , with following database operations :
- Support for basic CRUD: UPDATE, DELETE, INSERT, SELECT ALL, PAGED SELECT, FIND
- Support for queries using primary key
- Support for queries using foreign key
- Support for queries using keys that are part of an index
- Support for queries using keys that are part of a junction table
- Support for user defined Methods, generated from queries that are detected throught a very simple naming rule (_TableName_MyMethodName)
- Support for Deep loading and saving, with children type selection and optional recursivity.
- Support for find methods, with paging and sorting. (builded with the datagrid in mind :-)
- NEW: Support for SqlView.
- NEW: Select between stored procedure or xml embedded queries.
- Generate strongly-typed collections for entities and repositories.
- Implement CollectionBase , IBindingList, IList and ICloneable
- Sortable, even Unsortable !
- bindable to datagrid, or any winform or asp.net controls
- it creates ASP.NET webservice for distributed programming.
- Create the stored procedures script and can automatically install them on the server.
- Generates a complete nAnt build file, to compile, test and generate chm/html API documentation.
- A full set of nUnit tests.
- Each object has a concrete and a base class which it inherit from. The concrete class is generated just once, so you have can use it to add you custom code.
- the code is fully commented (it use to Description extended properties of the data table and column) and follow the microsoft naming guidelines.
- Open source ! You can modify the templates and contribute (http://www.sourceforge.net/projects/cstemplates)
官方站点:
http://cstemplates.sourceforge.net/
视频演示:
http://cstemplates.sourceforge.net/QuickStart/nettiers2.wmv
文档:
http://cstemplates.sourceforge.net/Documentation.chm
下载:
https://sourceforge.net/project/showfiles.php?group_id=118735