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

            foreach (Nettiers.AdventureWorks.Entities.Address item in items)
            {
                outItems[count++] = Convert(item);
            }
            return(outItems);
        }
        /// <summary>
        /// Convert a nettiers entity to the ws proxy entity.
        /// </summary>
        public static WsProxy.Address Convert(Nettiers.AdventureWorks.Entities.Address item)
        {
            WsProxy.Address outItem = new WsProxy.Address();
            outItem.AddressId       = item.AddressId;
            outItem.AddressLine1    = item.AddressLine1;
            outItem.AddressLine2    = item.AddressLine2;
            outItem.City            = item.City;
            outItem.StateProvinceId = item.StateProvinceId;
            outItem.PostalCode      = item.PostalCode;
            outItem.Rowguid         = item.Rowguid;
            outItem.ModifiedDate    = item.ModifiedDate;


            return(outItem);
        }
        /// <summary>
        ///     Gets rows from the datasource based on the PK_Address_AddressID index.
        /// </summary>
        /// <param name="start">Row number at which to start reading.</param>
        /// <param name="pageLength">Number of rows to return.</param>
        /// <param name="_addressId">Primary key for Address records.</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.Address"/> class.</returns>
        public override Nettiers.AdventureWorks.Entities.Address GetByAddressId(TransactionManager transactionManager, System.Int32 _addressId, int start, int pageLength, out int count)
        {
            try
            {
                WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
                proxy.Url = Url;
                WsProxy.Address items = proxy.AddressProvider_GetByAddressId(_addressId, 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>
        ///     Gets rows from the datasource based on the IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode index.
        /// </summary>
        /// <param name="start">Row number at which to start reading.</param>
        /// <param name="pageLength">Number of rows to return.</param>
        /// <param name="_addressLine1">First street address line.</param>
        /// <param name="_addressLine2">Second street address line.</param>
        /// <param name="_city">Name of the city.</param>
        /// <param name="_stateProvinceId">Unique identification number for the state or province. Foreign key to StateProvince table.</param>
        /// <param name="_postalCode">Postal code for the street address.</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.Address"/> class.</returns>
        public override Nettiers.AdventureWorks.Entities.Address GetByAddressLine1AddressLine2CityStateProvinceIdPostalCode(TransactionManager transactionManager, System.String _addressLine1, System.String _addressLine2, System.String _city, System.Int32 _stateProvinceId, System.String _postalCode, int start, int pageLength, out int count)
        {
            try
            {
                WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
                proxy.Url = Url;
                WsProxy.Address items = proxy.AddressProvider_GetByAddressLine1AddressLine2CityStateProvinceIdPostalCode(_addressLine1, _addressLine2, _city, _stateProvinceId, _postalCode, 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.Address object into the datasource using a transaction.
        /// </summary>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="entity">Nettiers.AdventureWorks.Entities.Address object to insert.</param>
        /// <remarks></remarks>
        /// <returns>Returns true if operation is successful.</returns>
        public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.Address entity)
        {
            WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
            proxy.Url = Url;

            try
            {
                WsProxy.Address result = proxy.AddressProvider_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.Address Convert(Nettiers.AdventureWorks.Entities.Address outItem, WsProxy.Address item)
        {
            if (item != null && outItem != null)
            {
                outItem.AddressId       = item.AddressId;
                outItem.AddressLine1    = item.AddressLine1;
                outItem.AddressLine2    = item.AddressLine2;
                outItem.City            = item.City;
                outItem.StateProvinceId = item.StateProvinceId;
                outItem.PostalCode      = item.PostalCode;
                outItem.Rowguid         = item.Rowguid;
                outItem.ModifiedDate    = item.ModifiedDate;

                outItem.AcceptChanges();
            }

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

							
			return outItem;
		}