/// <summary>
 /// Loads the items based on type
 /// </summary>
 /// <param name="Params">Parameters used to specify what to load</param>
 /// <returns>All items that fit the specified query</returns>
 public static IEnumerable <ObjectType> All(params IParameter[] Params)
 {
     return(All(ORM.CreateSession(), Params));
 }
 /// <summary>
 /// Deletes the item
 /// </summary>
 public virtual void Delete()
 {
     Delete(ORM.CreateSession());
 }
 /// <summary>
 /// Loads the item based on the ID
 /// </summary>
 /// <param name="Params">Parameters used to specify what to load</param>
 /// <returns>The specified item</returns>
 public static ObjectType Any(params IParameter[] Params)
 {
     return(Any(ORM.CreateSession(), Params));
 }
 /// <summary>
 /// Saves a list of objects
 /// </summary>
 /// <param name="Objects">List of objects</param>
 public static void Save(List <ObjectType> Objects)
 {
     ObjectBaseClass <ObjectType, IDType> .Save(Objects, ORM.CreateSession());
 }
 /// <summary>
 /// Saves the item (if it already exists, it updates the item.
 /// Otherwise it inserts the item)
 /// </summary>
 public virtual void Save()
 {
     Save(ORM.CreateSession());
 }
 /// <summary>
 /// Loads the item based on the ID
 /// </summary>
 /// <param name="Command">Command</param>
 /// <param name="CommandType">Command type</param>
 /// <param name="Params">Parameters used to specify what to load</param>
 /// <returns>The specified item</returns>
 public static ObjectType Any(string Command, CommandType CommandType, params IParameter[] Params)
 {
     return(Any(ORM.CreateSession(), Command, CommandType, Params));
 }
 /// <summary>
 /// Loads the items based on type
 /// </summary>
 /// <param name="Command">Command</param>
 /// <param name="CommandType">Command type</param>
 /// <param name="Params">Parameters used to specify what to load</param>
 /// <returns>All items that fit the specified query</returns>
 public static IEnumerable <ObjectType> All(string Command, CommandType CommandType, params IParameter[] Params)
 {
     return(All(ORM.CreateSession(), Command, CommandType, Params));
 }
 /// <summary>
 /// Runs a scalar command using the specified aggregate function
 /// </summary>
 /// <typeparam name="DataType">Data type</typeparam>
 /// <param name="AggregateFunction">Aggregate function</param>
 /// <param name="Parameters">Parameters</param>
 /// <returns>The scalar value returned by the command</returns>
 public static DataType Scalar <DataType>(string AggregateFunction, params IParameter[] Parameters)
 {
     return(Scalar <DataType>(ORM.CreateSession(), AggregateFunction, Parameters));
 }
 /// <summary>
 /// Runs a supplied scalar function and returns the result
 /// </summary>
 /// <param name="CommandType">Command type</param>
 /// <param name="Parameters">Parameters to search by</param>
 /// <param name="Command">Command to get the page count of</param>
 /// <typeparam name="DataType">Data type</typeparam>
 /// <returns>The scalar value returned by the command</returns>
 public static DataType Scalar <DataType>(string Command, CommandType CommandType, params IParameter[] Parameters)
 {
     return(Scalar <DataType>(ORM.CreateSession(), Command, CommandType, Parameters));
 }
 /// <summary>
 /// Gets the page count based on page size
 /// </summary>
 /// <param name="PageSize">Page size</param>
 /// <param name="Params">Parameters used to specify what to load</param>
 /// <param name="Command">Command to run</param>
 /// <returns>All items that fit the specified query</returns>
 public static int PageCount(string Command, int PageSize = 25, params IParameter[] Params)
 {
     return(PageCount(ORM.CreateSession(), Command, PageSize, Params));
 }
 /// <summary>
 /// Gets the page count based on page size
 /// </summary>
 /// <param name="PageSize">Page size</param>
 /// <param name="Params">Parameters used to specify what to load</param>
 /// <returns>All items that fit the specified query</returns>
 public static int PageCount(int PageSize = 25, params IParameter[] Params)
 {
     return(PageCount(ORM.CreateSession(), PageSize, Params));
 }
 /// <summary>
 /// Loads the items based on type
 /// </summary>
 /// <param name="OrderBy">What the data is ordered by</param>
 /// <param name="PageSize">Page size</param>
 /// <param name="CurrentPage">Current page (0 based)</param>
 /// <param name="Params">Parameters used to specify what to load</param>
 /// <param name="Command">Command to run</param>
 /// <returns>All items that fit the specified query</returns>
 public static IEnumerable <ObjectType> PagedCommand(string Command, string OrderBy = "", int PageSize = 25, int CurrentPage = 0, params IParameter[] Params)
 {
     return(PagedCommand(ORM.CreateSession(), Command, OrderBy, PageSize, CurrentPage, Params));
 }