/// <summary>
        /// Convert a collection from  to a nettiers collection to a the ws proxy collection.
        /// </summary>
        public static WsProxy.ProductModelIllustration[] Convert(Nettiers.AdventureWorks.Entities.TList <ProductModelIllustration> items)
        {
            WsProxy.ProductModelIllustration[] outItems = new WsProxy.ProductModelIllustration[items.Count];
            int count = 0;

            foreach (Nettiers.AdventureWorks.Entities.ProductModelIllustration item in items)
            {
                outItems[count++] = Convert(item);
            }
            return(outItems);
        }
        /// <summary>
        /// Convert a nettiers entity to the ws proxy entity.
        /// </summary>
        public static WsProxy.ProductModelIllustration Convert(Nettiers.AdventureWorks.Entities.ProductModelIllustration item)
        {
            WsProxy.ProductModelIllustration outItem = new WsProxy.ProductModelIllustration();
            outItem.ProductModelId = item.ProductModelId;
            outItem.IllustrationId = item.IllustrationId;
            outItem.ModifiedDate   = item.ModifiedDate;

            outItem.OriginalProductModelId = item.OriginalProductModelId;
            outItem.OriginalIllustrationId = item.OriginalIllustrationId;

            return(outItem);
        }
        /// <summary>
        ///     Gets rows from the datasource based on the PK_ProductModelIllustration_ProductModelID_IllustrationID index.
        /// </summary>
        /// <param name="start">Row number at which to start reading.</param>
        /// <param name="pageLength">Number of rows to return.</param>
        /// <param name="_productModelId">Primary key. Foreign key to ProductModel.ProductModelID.</param>
        /// <param name="_illustrationId">Primary key. Foreign key to Illustration.IllustrationID.</param>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="count">out parameter to get total records for query</param>
        /// <remarks></remarks>
        /// <returns>Returns an instance of the <see cref="Nettiers.AdventureWorks.Entities.ProductModelIllustration"/> class.</returns>
        public override Nettiers.AdventureWorks.Entities.ProductModelIllustration GetByProductModelIdIllustrationId(TransactionManager transactionManager, System.Int32 _productModelId, System.Int32 _illustrationId, int start, int pageLength, out int count)
        {
            try
            {
                WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
                proxy.Url = Url;
                WsProxy.ProductModelIllustration items = proxy.ProductModelIllustrationProvider_GetByProductModelIdIllustrationId(_productModelId, _illustrationId, start, pageLength, out count);

                return(Convert(items));
            }
            catch (SoapException soex)
            {
                System.Diagnostics.Debug.WriteLine(soex);
                throw soex;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                throw ex;
            }
        }
        /// <summary>
        ///     Inserts a Nettiers.AdventureWorks.Entities.ProductModelIllustration object into the datasource using a transaction.
        /// </summary>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="entity">Nettiers.AdventureWorks.Entities.ProductModelIllustration object to insert.</param>
        /// <remarks></remarks>
        /// <returns>Returns true if operation is successful.</returns>
        public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.ProductModelIllustration entity)
        {
            WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
            proxy.Url = Url;

            try
            {
                WsProxy.ProductModelIllustration result = proxy.ProductModelIllustrationProvider_Insert(Convert(entity));
                Convert(entity, result);
                return(true);
            }
            catch (SoapException soex)
            {
                System.Diagnostics.Debug.WriteLine(soex);
                throw soex;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                throw ex;
            }
        }
        /// <summary>
        /// Convert a nettiers collection to the ws proxy collection.
        /// </summary>
        public static Nettiers.AdventureWorks.Entities.ProductModelIllustration Convert(Nettiers.AdventureWorks.Entities.ProductModelIllustration outItem, WsProxy.ProductModelIllustration item)
        {
            if (item != null && outItem != null)
            {
                outItem.ProductModelId = item.ProductModelId;
                outItem.IllustrationId = item.IllustrationId;
                outItem.ModifiedDate   = item.ModifiedDate;

                outItem.OriginalProductModelId = item.ProductModelId;
                outItem.OriginalIllustrationId = item.IllustrationId;
                outItem.AcceptChanges();
            }

            return(outItem);
        }
 /// <summary>
 /// Convert a nettiers collection to the ws proxy collection.
 /// </summary>
 public static Nettiers.AdventureWorks.Entities.ProductModelIllustration Convert(WsProxy.ProductModelIllustration item)
 {
     Nettiers.AdventureWorks.Entities.ProductModelIllustration outItem = item == null ? null : new Nettiers.AdventureWorks.Entities.ProductModelIllustration();
     Convert(outItem, item);
     return(outItem);
 }
		/// <summary>
		/// Convert a collection from  to a nettiers collection to a the ws proxy collection.
		/// </summary>
		public static WsProxy.ProductModelIllustration[] Convert(Nettiers.AdventureWorks.Entities.TList<ProductModelIllustration> items)
		{
			WsProxy.ProductModelIllustration[] outItems = new WsProxy.ProductModelIllustration[items.Count];
			int count = 0;
		
			foreach (Nettiers.AdventureWorks.Entities.ProductModelIllustration item in items)
			{
				outItems[count++] = Convert(item);
			}
			return outItems;
		}
		/// <summary>
		/// Convert a nettiers entity to the ws proxy entity.
		/// </summary>
		public static WsProxy.ProductModelIllustration Convert(Nettiers.AdventureWorks.Entities.ProductModelIllustration item)
		{			
			WsProxy.ProductModelIllustration outItem = new WsProxy.ProductModelIllustration();			
			outItem.ProductModelId = item.ProductModelId;
			outItem.IllustrationId = item.IllustrationId;
			outItem.ModifiedDate = item.ModifiedDate;

			outItem.OriginalProductModelId = item.OriginalProductModelId;
			outItem.OriginalIllustrationId = item.OriginalIllustrationId;
							
			return outItem;
		}