Castle ActiveRecord Documentation
June 4, 2015 ยท View on GitHub
The Castle ActiveRecord project is an implementation of the ActiveRecord pattern for .NET. The ActiveRecord pattern consists on instance properties representing a record in the database, instance methods acting on that specific record and static methods acting on all records.
Castle ActiveRecord is built on top of NHibernate, but its attribute-based mapping frees the developer of writing XML for database-to-object mapping, which is needed when using NHibernate directly.
:warning: Warning: Although ActiveRecord makes using NHibernate easy it does not hide all details of NHibernate behaviour. You need to understand NHibernate flushing behaviour and how to work with text/ntext columns.
Reference Manual
- Understanding Scopes - Explains the SessionScope and TransactionScope classes
- Validators
- XML Configuration Reference
User's Guide
- Getting Started - A tutorial for "how", after the introduction explains "what"
- Configuration and Initialization - Explains the configuration options and schema, and provides some illustrative examples as well
- Creating an ActiveRecord class
- The Persistency Lifecycle
- Primary Key Mapping
- Simple Column Mapping
- Relations Mapping
- Schema Generation
- Unit Testing
- Type Hierarchy - Discuss approaches to achieve inheritance within your object model and map it correctly to the underlying database
- Nested Data (NHibernate Components)
- Using HQL (Hibernate Query Language) - Illustrates the usage of HQL
- Native SQL Queries
- Using Scopes
- Enabling Lazy Load
- Validation Support - Presents the ActiveRecordValidationBase that is able to validate properties with predefined validators
- Best Practices - Some recommendations
- Web Applications
- Troubleshooting - Something went wrong? Check what problems we had and how we work around them
- Frequently Asked Questions
- External Articles on ActiveRecord
Advanced Usage
- Using the ActiveRecordMediator (avoiding a base class)
- Using Version and Timestamp
- Using Imports
- Hooks and Lifecycle
- Framework Events
- Accessing more than one database
- Tuning (Performance Improvements)
- ByteCode Generator and Scopeless Lazy Loading