static void

NHibernate Entities

See the Sample hbm mapping for these entities. Mostly, this is just a POCO (plain old CLR object).

Category

using System;
using System.Collections.Generic;
using System.Diagnostics;
 
namespace Northwind
{
   /// <summary>
   /// Class representing Categories table
   /// </summary>
   [Serializable]
   public class Category : EntityBase<int, Category>
   {
 
      #region Fields
      [DebuggerBrowsable(DebuggerBrowsableState.Never)]
      private IList<Product> _productCollection = new List<Product>();
      #endregion
 
      #region Properties
      /// <summary>
      /// CategoryName (Required)
      /// </summary>
      public virtual string CategoryName { get; set; }
      /// <summary>
      /// Description
      /// </summary>
      public virtual string Description { get; set; }
      /// <summary>
      /// Picture
      /// </summary>
      public virtual System.Byte[] Picture { get; set; }
      /// <summary>
      /// Foreign Key Collection
      /// </summary>
      public virtual IList<Product> ProductCollection
      {
            get
            {
               return _productCollection;
            }
      }
      #endregion
 
      #region overrides
      public override string ToString()
      {
         return "Category = " + Id;
      }
 
      #endregion
   } //class
} //namespace

Product

using System;
using System.Collections.Generic;
using System.Diagnostics;
 
namespace Northwind
{
   /// <summary>
   /// Class representing Products table
   /// </summary>
   [Serializable]
   public class Product : EntityBase<int, Product>
   {
 
      #region Properties
      /// <summary>
      /// ProductName (Required)
      /// </summary>
      public virtual string ProductName { get; set; }
      ///// <summary>
      ///// Foreign Key Entity for SupplierId (Optional)
      ///// </summary>
      //public virtual Supplier Supplier { get; set; }
      /// <summary>
      /// Foreign Key Entity for CategoryId (Optional)
      /// </summary>
      public virtual Category Category { get; set; }
      /// <summary>
      /// QuantityPerUnit
      /// </summary>
      public virtual string QuantityPerUnit { get; set; }
      /// <summary>
      /// UnitPrice
      /// </summary>
      public virtual decimal? UnitPrice { get; set; }
      /// <summary>
      /// UnitsInStock
      /// </summary>
      public virtual short? UnitsInStock { get; set; }
      /// <summary>
      /// UnitsOnOrder
      /// </summary>
      public virtual short? UnitsOnOrder { get; set; }
      /// <summary>
      /// ReorderLevel
      /// </summary>
      public virtual short? ReorderLevel { get; set; }
      /// <summary>
      /// Discontinued (Required)
      /// </summary>
      public virtual bool Discontinued { get; set; }
      #endregion
 
      #region overrides
      public override string ToString()
      {
         return "Product = " + Id;
      }
 
      #endregion
   } //class
} //namespace