C# (CSharp) Editor.Utils Namespace

Classes

Name Description
AssertionException Exception raised when an assertion fails.
Check Design By Contract Checks. Each method generates an exception or a trace assertion statement if the contract is broken.
DesignByContractException Exception raised when a contract is broken. Catch this exception type if you wish to differentiate between any DesignByContract exception and other runtime exceptions.
InvariantException Exception raised when an invariant fails.
NHibernateSessionManager Handles creation and management of sessions and transactions. It is a singleton because building the initial session factory is very expensive. Inspiration for this class came from Chapter 8 of Hibernate in Action by Bauer and King. Although it is a sealed singleton you can use TypeMock (http://www.typemock.com) for more flexible testing.
NHibernateSessionManager.Nested Assists with ensuring thread-safe, lazy singleton
OpenSessionInViewSection Encapsulates a section of Web/App.config to declare which session factories are to be created. Huge kudos go out to http://msdn2.microsoft.com/en-us/library/system.configuration.configurationcollectionattribute.aspx for this technique - it was by far the best overview of the subject.
PostconditionException Exception raised when a postcondition fails.
PreconditionException Exception raised when a precondition fails.
SessionFactoriesCollection
SessionFactoryElement