HowTo: Enable intellisense for entities and properties

In order to enable entities and properties intellisense you must export your nhibernate configuration. Remember that you can export on any project of your solution, even in a data test project.

Step 1: Add a reference to System.ComponentModel.Composition

Step 2: Add a class with your configuration as follows:

	public class ConfigurationExporter 
		public static Configuration Configuration
				var configuration = new Configuration();
				var assemblyWithMappings = typeof(ConfigurationExporter);
				configuration.Properties[Environment.Dialect] = typeof(MsSql2005Dialect).FullName;
				return configuration;	
Note: if you have a full hibernate.cfg.xml (with the mapping-assembly tag) you don’t need to do anything else, just use “return new Configuration().Configure”.

Last edited Sep 22, 2010 at 12:54 PM by jfromaniello, version 5


No comments yet.