Exemple #1
0
        public static dataModel.Contact ToDataModel(this coreModel.Contact contact, PrimaryKeyResolvingMap pkMap)
        {
            if (contact == null)
                throw new ArgumentNullException("contact");

            var retVal = new dataModel.Contact();

            contact.ToDataModel(retVal);

            if (retVal.Name == null)
            {
                retVal.Name = retVal.FullName;
            }

            pkMap.AddPair(contact, retVal);

            if (contact.Organizations != null)
            {
                retVal.MemberRelations = new ObservableCollection<dataModel.MemberRelation>();
                foreach (var organization in contact.Organizations)
                {
                    var memberRelation = new dataModel.MemberRelation
                    {
                        AncestorId = organization,
                        AncestorSequence = 1,
                        DescendantId = retVal.Id,
                    };
                    retVal.MemberRelations.Add(memberRelation);
                }
            }
            return (dataModel.Contact)retVal;
        }
 public override MemberDataEntity FromMember(Member member, PrimaryKeyResolvingMap pkMap)
 {
     var contact = member as Contact;
     if (contact != null)
     {
         if (string.IsNullOrEmpty(this.Name))
         {
             this.Name = contact.FullName;
         }
         pkMap.AddPair(contact, this);
         if (contact.Organizations != null)
         {
             this.MemberRelations = new ObservableCollection<MemberRelationDataEntity>();
             foreach (var organization in contact.Organizations)
             {
                 var memberRelation = new MemberRelationDataEntity
                 {
                     AncestorId = organization,
                     AncestorSequence = 1,
                     DescendantId = this.Id,
                 };
                 this.MemberRelations.Add(memberRelation);
             }
         }
     }
     //Call base converter
     return base.FromMember(member, pkMap);
 }
		public static ShipmentItemEntity ToDataModel(this ShipmentItem shipmentItem, ShoppingCartEntity cartEntity, PrimaryKeyResolvingMap pkMap)
		{
			if (shipmentItem == null)
				throw new ArgumentNullException("shipmentItem");

			var retVal = new ShipmentItemEntity();
            pkMap.AddPair(shipmentItem, retVal);
            retVal.InjectFrom(shipmentItem);

            //Try to find cart line item by shipment item
            if(!String.IsNullOrEmpty(shipmentItem.LineItemId))
            {
                retVal.LineItem = cartEntity.Items.FirstOrDefault(x => x.Id == shipmentItem.LineItemId);
            }
            if(retVal.LineItem == null && shipmentItem.LineItem != null)
            {
                retVal.LineItem = cartEntity.Items.FirstOrDefault(x => x.Id == shipmentItem.LineItem.Id);
            }
            if (retVal.LineItem == null && shipmentItem.LineItem != null)
            {
                retVal.LineItem = cartEntity.Items.FirstOrDefault(x => x.ProductId == shipmentItem.LineItem.ProductId);
            }
            if(retVal.LineItem != null && !String.IsNullOrEmpty(retVal.LineItem.Id))
            {
                retVal.LineItemId = retVal.LineItem.Id;
                retVal.LineItem = null;
            }
         
			return retVal;
		}
		public static ShipmentEntity ToDataModel(this Shipment shipment, ShoppingCartEntity cartEntity, PrimaryKeyResolvingMap pkMap)
		{
			if (shipment == null)
				throw new ArgumentNullException("shipment");

			var retVal = new ShipmentEntity();
            pkMap.AddPair(shipment, retVal);

            retVal.InjectFrom(shipment);
	
			retVal.Currency = shipment.Currency.ToString();
		
			if (shipment.DeliveryAddress != null)
			{
				retVal.Addresses = new ObservableCollection<AddressEntity>(new AddressEntity[] { shipment.DeliveryAddress.ToDataModel() });
			}
			if (shipment.Items != null)
			{
				retVal.Items = new ObservableCollection<ShipmentItemEntity>(shipment.Items.Select(x => x.ToDataModel(cartEntity, pkMap)));
			}
			if (shipment.TaxDetails != null)
			{
				retVal.TaxDetails = new ObservableCollection<TaxDetailEntity>();
				retVal.TaxDetails.AddRange(shipment.TaxDetails.Select(x => x.ToDataModel()));
			}
            if (shipment.Discounts != null)
            {
                retVal.Discounts = new ObservableCollection<DiscountEntity>();
                retVal.Discounts.AddRange(shipment.Discounts.Select(x => x.ToDataModel(pkMap)));
            }
            return retVal;
		}
        public static dataModel.Organization ToDataModel(this coreModel.Organization organization, PrimaryKeyResolvingMap pkMap)
        {
            if (organization == null)
                throw new ArgumentNullException("organization");

            var retVal = new dataModel.Organization();
            pkMap.AddPair(organization, retVal);

            retVal.InjectFrom(organization);

            if (organization.Phones != null)
            {
                retVal.Phones = new ObservableCollection<dataModel.Phone>(organization.Phones.Select(x => new dataModel.Phone
                {
                    Number = x,
                    MemberId = organization.Id
                }));
            }

            if (organization.Emails != null)
            {
                retVal.Emails = new ObservableCollection<dataModel.Email>(organization.Emails.Select(x => new dataModel.Email
                {
                    Address = x,
                    MemberId = organization.Id
                }));
            }

            if (organization.Addresses != null)
            {
                retVal.Addresses = new ObservableCollection<dataModel.Address>(organization.Addresses.Select(x => x.ToDataModel()));
                foreach (var address in retVal.Addresses)
                {
                    address.MemberId = organization.Id;
                }
            }

            if (organization.Notes != null)
            {
                retVal.Notes = new ObservableCollection<dataModel.Note>(organization.Notes.Select(x => x.ToDataModel()));
                foreach (var note in retVal.Notes)
                {
                    note.MemberId = organization.Id;
                }
            }

            if (organization.ParentId != null)
            {
                retVal.MemberRelations = new ObservableCollection<dataModel.MemberRelation>();
                var memberRelation = new dataModel.MemberRelation
                {
                    AncestorId = organization.ParentId,
                    DescendantId = organization.Id,
                    AncestorSequence = 1

                };
                retVal.MemberRelations.Add(memberRelation);
            }
            return retVal;
        }
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        /// <param name="catalog"></param>
        /// <returns></returns>
        public static dataModel.Catalog ToDataModel(this coreModel.Catalog catalog, PrimaryKeyResolvingMap pkMap)
        {
            if (catalog == null)
                throw new ArgumentNullException("catalog");

			if(catalog.DefaultLanguage == null)
				throw new NullReferenceException("DefaultLanguage");

            var retVal = new dataModel.Catalog();
            pkMap.AddPair(catalog, retVal);

            if (catalog.PropertyValues != null)
            {
                retVal.CatalogPropertyValues = new ObservableCollection<dataModel.PropertyValue>();
                retVal.CatalogPropertyValues.AddRange(catalog.PropertyValues.Select(x => x.ToDataModel(pkMap)));
            }

            retVal.InjectFrom(catalog);

            retVal.DefaultLanguage = catalog.DefaultLanguage.LanguageCode;

            if (catalog.Languages != null)
            {
                retVal.CatalogLanguages = new ObservableCollection<dataModel.CatalogLanguage>();
                retVal.CatalogLanguages.AddRange(catalog.Languages.Select(x => x.ToDataModel()));
            }

            return retVal;
        }
		/// <summary>
		/// Converting to foundation type
		/// </summary>
		public static dataModel.Asset ToDataModel(this coreModel.Asset asset, PrimaryKeyResolvingMap pkMap)
		{
			if (asset == null)
				throw new ArgumentNullException("asset");

			var retVal = new dataModel.Asset();
            pkMap.AddPair(asset, retVal);
            retVal.InjectFrom(asset);
			return retVal;
		}
		/// <summary>
		/// Converting to foundation type
		/// </summary>
		public static dataModel.Image ToDataModel(this coreModel.Image image, PrimaryKeyResolvingMap pkMap)
		{
			if (image == null)
				throw new ArgumentNullException("image");

			var retVal = new dataModel.Image();
            pkMap.AddPair(image, retVal);
            retVal.InjectFrom(image);
	
			return retVal;
		}
		public static dataModel.DynamicContentItem ToDataModel(this coreModel.DynamicContentItem contentItem, PrimaryKeyResolvingMap pkMap)
		{
			if (contentItem == null)
				throw new ArgumentNullException("contentItem");

			var retVal = new dataModel.DynamicContentItem();
            pkMap.AddPair(contentItem, retVal);
            retVal.InjectFrom(contentItem);
			retVal.ContentTypeId = contentItem.ContentType;
		
		
			return retVal;
		}
        public static dataModel.QuoteItemEntity ToDataModel(this coreModel.QuoteItem quoteItem, PrimaryKeyResolvingMap pkMap)
		{
			if (quoteItem == null)
				throw new ArgumentNullException("quoteItem");

			var retVal = new dataModel.QuoteItemEntity();
            pkMap.AddPair(quoteItem, retVal);
            retVal.InjectFrom(quoteItem);
            retVal.Currency = quoteItem.Currency.ToString();
            if (quoteItem.ProposalPrices != null)
			{
				retVal.ProposalPrices = new ObservableCollection<dataModel.TierPriceEntity>(quoteItem.ProposalPrices.Select(x => x.ToDataModel()));
			}

			return retVal;
		}
		public static ShipmentPackageEntity ToDataModel(this ShipmentPackage package, CustomerOrderEntity orderEntity, PrimaryKeyResolvingMap pkMap)
		{
			if (package == null)
				throw new ArgumentNullException("package");

			var retVal = new ShipmentPackageEntity();
            pkMap.AddPair(package, retVal);
            retVal.InjectFrom(package);

			if(package.Items != null)
			{
				retVal.Items = new ObservableCollection<ShipmentItemEntity>(package.Items.Select(x => x.ToDataModel(orderEntity, pkMap)));
			}

			return retVal;
		}
		/// <summary>
		/// Converting to foundation type
		/// </summary>
		/// <param name="itemAsset">The item asset.</param>
		/// <returns></returns>
		/// <exception cref="System.ArgumentNullException">itemAsset</exception>
		public static dataModel.EditorialReview ToDataModel(this coreModel.EditorialReview review, dataModel.Item product, PrimaryKeyResolvingMap pkMap)
		{
			if (review == null)
				throw new ArgumentNullException("review");

			var retVal = new dataModel.EditorialReview();
            pkMap.AddPair(review, retVal);
            retVal.InjectFrom(review);

			retVal.ItemId = product.Id;
			retVal.Source = review.ReviewType;
			retVal.ReviewState = (int)coreModel.ReviewState.Active;
			retVal.Locale = review.LanguageCode;

			return retVal;
		}
		public static PaymentEntity ToDataModel(this Payment payment, PrimaryKeyResolvingMap pkMap)
		{
			if (payment == null)
				throw new ArgumentNullException("payment");

			var retVal = new PaymentEntity();
            pkMap.AddPair(payment, retVal);
            retVal.InjectFrom(payment);

			retVal.Currency = payment.Currency.ToString();

			if (payment.BillingAddress != null)
			{
				retVal.Addresses = new ObservableCollection<AddressEntity>(new AddressEntity[] { payment.BillingAddress.ToDataModel() });
			}
			return retVal;
		}
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="propValue">The property value.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">propValue</exception>
        public static dataModel.PropertyValue ToDataModel(this coreModel.PropertyValue propValue, PrimaryKeyResolvingMap pkMap) 
        {
            if (propValue == null)
                throw new ArgumentNullException("propValue");

            var retVal = new dataModel.PropertyValue();
            pkMap.AddPair(propValue, retVal);
            retVal.InjectFrom(propValue);
   
            retVal.Name = propValue.PropertyName;
            retVal.KeyValue = propValue.ValueId;
            retVal.Locale = propValue.LanguageCode;
            retVal.ValueType = (int)propValue.ValueType;
            SetPropertyValue(retVal, propValue.ValueType, propValue.Value.ToString());

            return retVal;
        }
        public static PaymentInEntity ToDataModel(this PaymentIn paymentIn, CustomerOrderEntity orderEntity, PrimaryKeyResolvingMap pkMap)
        {
            if (paymentIn == null)
                throw new ArgumentNullException("paymentIn");

            var retVal = new PaymentInEntity();
            pkMap.AddPair(paymentIn, retVal);
            retVal.InjectFrom(paymentIn);

            retVal.Currency = paymentIn.Currency.ToString();
            retVal.Status = paymentIn.PaymentStatus.ToString();


            if (paymentIn.BillingAddress != null)
            {
                retVal.Addresses = new ObservableCollection<AddressEntity>(new AddressEntity[] { paymentIn.BillingAddress.ToDataModel() });
            }
            return retVal;
        }
        public override MemberDataEntity FromMember(Member member, PrimaryKeyResolvingMap pkMap)
        {
            var organization = member as Organization;
            pkMap.AddPair(organization, this);

            if (organization.ParentId != null)
            {
                this.MemberRelations = new ObservableCollection<MemberRelationDataEntity>();
                var memberRelation = new MemberRelationDataEntity
                {
                    AncestorId = organization.ParentId,
                    DescendantId = organization.Id,
                    AncestorSequence = 1
                };
                this.MemberRelations.Add(memberRelation);
            }

            //Call base converter
            return base.FromMember(member, pkMap);
        }
		public static LineItemEntity ToDataModel(this LineItem lineItem, PrimaryKeyResolvingMap pkMap)
		{
			if (lineItem == null)
				throw new ArgumentNullException("lineItem");

			var retVal = new LineItemEntity();
            pkMap.AddPair(lineItem, retVal);

            retVal.InjectFrom(lineItem);
			retVal.Currency = lineItem.Currency.ToString();
			if(lineItem.Discount != null)
			{
				retVal.Discounts = new ObservableCollection<DiscountEntity>(new DiscountEntity[] { lineItem.Discount.ToDataModel() });
			}
			if(lineItem.TaxDetails != null)
			{
				retVal.TaxDetails = new ObservableCollection<TaxDetailEntity>();
				retVal.TaxDetails.AddRange(lineItem.TaxDetails.Select(x=>x.ToDataModel()));
			}
			return retVal;
		}
        public static ShoppingCartEntity ToDataModel(this ShoppingCart cart, PrimaryKeyResolvingMap pkMap)
		{
			if (cart == null)
				throw new ArgumentNullException("cart");

			var retVal = new ShoppingCartEntity();
            pkMap.AddPair(cart, retVal);

            retVal.InjectFrom(cart);

			retVal.Currency = cart.Currency.ToString();

			if (cart.Addresses != null)
			{
				retVal.Addresses = new ObservableCollection<AddressEntity>(cart.Addresses.Select(x => x.ToDataModel()));
			}
			if (cart.Items != null)
			{
				retVal.Items = new ObservableCollection<LineItemEntity>(cart.Items.Select(x => x.ToDataModel(pkMap)));
			}
			if (cart.Shipments != null)
			{
				retVal.Shipments = new ObservableCollection<ShipmentEntity>(cart.Shipments.Select(x => x.ToDataModel(retVal, pkMap)));
			}
			if (cart.Payments != null)
			{
				retVal.Payments = new ObservableCollection<PaymentEntity>(cart.Payments.Select(x => x.ToDataModel(pkMap)));
			}
			if (cart.TaxDetails != null)
			{
				retVal.TaxDetails = new ObservableCollection<TaxDetailEntity>();
				retVal.TaxDetails.AddRange(cart.TaxDetails.Select(x => x.ToDataModel()));
			}
            if (cart.Discounts != null)
            {
                retVal.Discounts = new ObservableCollection<DiscountEntity>();
                retVal.Discounts.AddRange(cart.Discounts.Select(x => x.ToDataModel(pkMap)));
            }
            return retVal;
		}
        public static dataModel.QuoteRequestEntity ToDataModel(this coreModel.QuoteRequest quoteRequest, PrimaryKeyResolvingMap pkMap)
		{
			if (quoteRequest == null)
				throw new ArgumentNullException("quoteRequest");

			var retVal = new dataModel.QuoteRequestEntity();
            pkMap.AddPair(quoteRequest, retVal);
            retVal.InjectFrom(quoteRequest);

			if (quoteRequest.ShipmentMethod != null)
			{
				retVal.ShipmentMethodCode = quoteRequest.ShipmentMethod.ShipmentMethodCode;
				retVal.ShipmentMethodOption = quoteRequest.ShipmentMethod.OptionName;
			}
            retVal.Currency = quoteRequest.Currency.ToString();
            if (quoteRequest.Addresses != null)
			{
				retVal.Addresses = new ObservableCollection<dataModel.AddressEntity>(quoteRequest.Addresses.Select(x => x.ToDataModel()));
			}
			if (quoteRequest.Attachments != null)
			{
				retVal.Attachments = new ObservableCollection<dataModel.AttachmentEntity>(quoteRequest.Attachments.Select(x => x.ToDataModel()));
			}
			if (quoteRequest.Items != null)
			{
				retVal.Items = new ObservableCollection<dataModel.QuoteItemEntity>(quoteRequest.Items.Select(x => x.ToDataModel(pkMap)));
			}
			return retVal;
		}
		/// <summary>
		/// Converting to foundation type
		/// </summary>
		/// <param name="catalog"></param>
		/// <returns></returns>
		public static dataModel.Item ToDataModel(this coreModel.CatalogProduct product, PrimaryKeyResolvingMap pkMap)
		{
			var retVal = new dataModel.Item();
            pkMap.AddPair(product, retVal);
            retVal.InjectFrom(product);
	        
			if(product.StartDate == default(DateTime))
			{
				retVal.StartDate = DateTime.UtcNow;
			}

			retVal.IsActive = product.IsActive ?? true;
			retVal.IsBuyable = product.IsBuyable ?? true;
			retVal.TrackInventory = product.TrackInventory ?? true;
			retVal.MaxQuantity = product.MaxQuantity ?? 0;
			retVal.MinQuantity = product.MinQuantity ?? 0;

			retVal.ParentId = product.MainProductId;
			//Constant fields
			//Only for main product
			retVal.AvailabilityRule = (int)coreModel.AvailabilityRule.Always;
			retVal.MinQuantity = 1;
			retVal.MaxQuantity = 0;

			retVal.CatalogId = product.CatalogId;
			retVal.CategoryId = String.IsNullOrEmpty(product.CategoryId) ? null : product.CategoryId;

			#region ItemPropertyValues
			if (product.PropertyValues != null)
			{
				retVal.ItemPropertyValues = new ObservableCollection<dataModel.PropertyValue>();
                retVal.ItemPropertyValues.AddRange(product.PropertyValues.Where(x => !x.IsInherited).Select(x => x.ToDataModel(pkMap)));
            }
			#endregion

			#region Assets
			if (product.Assets != null)
			{
                retVal.Assets = new ObservableCollection<dataModel.Asset>(product.Assets.Where(x => !x.IsInherited).Select(x => x.ToDataModel(pkMap)));
            }
			#endregion

			#region Images
			if (product.Images != null)
			{
                retVal.Images = new ObservableCollection<dataModel.Image>(product.Images.Where(x => !x.IsInherited).Select(x => x.ToDataModel(pkMap)));
            }
			#endregion

			#region Links
			if (product.Links != null)
			{
				retVal.CategoryLinks = new ObservableCollection<dataModel.CategoryItemRelation>();
				retVal.CategoryLinks.AddRange(product.Links.Select(x => x.ToDataModel(product)));
			}
			#endregion

			#region EditorialReview
			if (product.Reviews != null)
			{
				retVal.EditorialReviews = new ObservableCollection<dataModel.EditorialReview>();
                retVal.EditorialReviews.AddRange(product.Reviews.Where(x => !x.IsInherited).Select(x => x.ToDataModel(retVal, pkMap)));
            }
			#endregion

			#region Associations
			if (product.Associations != null)
			{
				retVal.AssociationGroups = new ObservableCollection<dataModel.AssociationGroup>();
				var associations = product.Associations.ToArray();
				for (int order = 0; order < associations.Count(); order++)
				{
					var association = associations[order];
					var associationGroup = retVal.AssociationGroups.FirstOrDefault(x => x.Name == association.Name);
					if (associationGroup == null)
					{
						associationGroup = new dataModel.AssociationGroup
						{
							Name = association.Name,
							Description = association.Description,
							Priority = 1,
						};
						retVal.AssociationGroups.Add(associationGroup);
					}
					var foundationAssociation = association.ToDataModel();
					foundationAssociation.Priority = order;
					associationGroup.Associations.Add(foundationAssociation);
				}
			}
			#endregion

			return retVal;
		}
		public static CustomerOrderEntity ToDataModel(this CustomerOrder order, PrimaryKeyResolvingMap pkMap)
		{
			if (order == null)
				throw new ArgumentNullException("order");

			var retVal = new CustomerOrderEntity();
            pkMap.AddPair(order, retVal);
            retVal.InjectFrom(order);

			retVal.Currency = order.Currency.ToString();

	
			if(order.Addresses != null)
			{
				retVal.Addresses = new ObservableCollection<AddressEntity>(order.Addresses.Select(x=>x.ToDataModel()));
			}
			if(order.Items != null)
			{
				retVal.Items = new ObservableCollection<LineItemEntity>(order.Items.Select(x=>x.ToDataModel(pkMap)));
			}
			if(order.Shipments != null)
			{
				retVal.Shipments = new ObservableCollection<ShipmentEntity>(order.Shipments.Select(x => x.ToDataModel(retVal, pkMap)));
			}
			if(order.InPayments != null)
			{
				retVal.InPayments = new ObservableCollection<PaymentInEntity>(order.InPayments.Select(x => x.ToDataModel(retVal, pkMap)));
			}
			if(order.Discount != null)
			{
				retVal.Discounts = new ObservableCollection<DiscountEntity>(new DiscountEntity[] { order.Discount.ToDataModel() });
			}
			if (order.TaxDetails != null)
			{
				retVal.TaxDetails = new ObservableCollection<TaxDetailEntity>();
				retVal.TaxDetails.AddRange(order.TaxDetails.Select(x => x.ToDataModel()));
			}
			return retVal;
		}
		public static ShipmentEntity ToDataModel(this Shipment shipment, CustomerOrderEntity orderEntity, PrimaryKeyResolvingMap pkMap)
		{
			if (shipment == null)
				throw new ArgumentNullException("shipment");

			var retVal = new ShipmentEntity();
			retVal.InjectFrom(shipment);
            pkMap.AddPair(shipment, retVal);

            retVal.Currency = shipment.Currency.ToString();

		
			//Allow to empty address
			retVal.Addresses = new ObservableCollection<AddressEntity>();
			if (shipment.DeliveryAddress != null)
			{
				retVal.Addresses = new ObservableCollection<AddressEntity>(new AddressEntity[] { shipment.DeliveryAddress.ToDataModel() });
			}
			if(shipment.Items != null)
			{
				retVal.Items = new ObservableCollection<ShipmentItemEntity>(shipment.Items.Select(x=>x.ToDataModel(orderEntity, pkMap)));
			}
			if (shipment.Packages != null)
			{
				retVal.Packages = new ObservableCollection<ShipmentPackageEntity>(shipment.Packages.Select(x => x.ToDataModel(orderEntity, pkMap)));
			}
			if (shipment.TaxDetails != null)
			{
				retVal.TaxDetails = new ObservableCollection<TaxDetailEntity>();
				retVal.TaxDetails.AddRange(shipment.TaxDetails.Select(x => x.ToDataModel()));
			}
			return retVal;
		}
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        /// <param name="category">The category.</param>
        /// <returns></returns>
        public static dataModel.Category ToDataModel(this coreModel.Category category, PrimaryKeyResolvingMap pkMap)
        {
			var retVal = new dataModel.Category();
            pkMap.AddPair(category, retVal);
            retVal.InjectFrom(category);
	
			retVal.ParentCategoryId = category.ParentId;
			retVal.EndDate = DateTime.UtcNow.AddYears(100);
			retVal.StartDate = DateTime.UtcNow;
			retVal.IsActive = category.IsActive ?? true;
          
            if (category.PropertyValues != null)
            {
                retVal.CategoryPropertyValues = new ObservableCollection<dataModel.PropertyValue>();
                retVal.CategoryPropertyValues.AddRange(category.PropertyValues.Select(x => x.ToDataModel(pkMap)));
            }

            if (category.Links != null)
            {
				retVal.OutgoingLinks = new ObservableCollection<dataModel.CategoryRelation>();
				retVal.OutgoingLinks.AddRange(category.Links.Select(x => x.ToDataModel(category)));
            }

			#region Images
			if (category.Images != null)
			{
				retVal.Images = new ObservableCollection<dataModel.Image>(category.Images.Select(x=>x.ToDataModel(pkMap)));
			}
			#endregion

            return retVal;
        }