Exemplo n.º 1
0
        /// <summary>
        /// Retrieve an instance of the mapped class from a DbDataReader. Implementors
        /// should handle possibility of null values.
        /// </summary>
        /// <param name="dr">DbDataReader</param>
        /// <param name="names">the column names</param>
        /// <param name="session"></param>
        /// <param name="owner">the containing entity</param>
        /// <returns></returns>
        public object NullSafeGet(DbDataReader dr, string[] names, ISessionImplementor session, object owner)
        {
            var data = new CompositeData();

            data.DataA = (DateTime)NHibernateUtil.DateTime.NullSafeGet(dr, new[] { names[0] }, session, owner);
            data.DataB = (DateTime)NHibernateUtil.DateTime.NullSafeGet(dr, new[] { names[1] }, session, owner);

            return(data);
        }
Exemplo n.º 2
0
		/// <summary>
		/// Retrieve an instance of the mapped class from a IDataReader. Implementors
		/// should handle possibility of null values.
		/// </summary>
		/// <param name="dr">IDataReader</param>
		/// <param name="names">the column names</param>
		/// <param name="session"></param>
		/// <param name="owner">the containing entity</param>
		/// <returns></returns>
		public object NullSafeGet(IDataReader dr, string[] names, ISessionImplementor session, object owner)
		{
			var data = new CompositeData();
			data.DataA = (DateTime) NHibernateUtil.DateTime.NullSafeGet(dr, new[] {names[0]}, session, owner);
			data.DataB = (DateTime) NHibernateUtil.DateTime.NullSafeGet(dr, new[] {names[1]}, session, owner);

			return data;
		}