Microsoft.SqlServer.Types.HierarchyId mapping support for NHibernate
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

NHiberntate HierarchyId UserType v1.0.0

Download Solution | Assembly


<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataLayer" namespace="NHibernate.Map">
	<class name="NHibernate.Map.OrganizationUnit, DataLayer" table="`orgunit`">

		<property name="HierarchyId" column="`ou_hid`" type="NHibernate.HierarchyId.UserType, NHibernate.HierarchyId.UserType" />


Object with SqlHierarchyId

namespace NHibernate.Map
	using Microsoft.SqlServer.Types;

	public class OrganizationUnit
		#region Fields

		private SqlHierarchyId _hierarchyId;

		#endregion Fields

		#region Properties

		public virtual SqlHierarchyId HierarchyId
			get { return _hierarchyId; }
			set { _hierarchyId = value; }

		#endregion Properties