当前位置: 首页>>代码示例>>C#>>正文


C# ICollection.CompareTo方法代码示例

本文整理汇总了C#中ICollection.CompareTo方法的典型用法代码示例。如果您正苦于以下问题:C# ICollection.CompareTo方法的具体用法?C# ICollection.CompareTo怎么用?C# ICollection.CompareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICollection的用法示例。


在下文中一共展示了ICollection.CompareTo方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateOrganizations

 private void UpdateOrganizations(ICollection<Organization> original, ICollection<Organization> backup)
 {
     var organizationsToUpdate = new List<Organization>();
     backup.CompareTo(original, EqualityComparer<Organization>.Default, (state, x, y) =>
     {
         switch (state)
         {
             case EntryState.Modified:
                 organizationsToUpdate.Add(x);
                 break;
             case EntryState.Added:
                 _organizationService.Create(x);
                 break;
         }
     });
     _organizationService.Update(organizationsToUpdate.ToArray());
 }
开发者ID:afandylamusu,项目名称:vc-community,代码行数:17,代码来源:CustomerExportImport.cs

示例2: UpdateContacts

 private void UpdateContacts(ICollection<Contact> original, ICollection<Contact> backup)
 {
     var contactsToUpdate = new List<Contact>();
     backup.CompareTo(original, EqualityComparer<Contact>.Default, (state, x, y) =>
     {
         switch (state)
         {
             case EntryState.Modified:
                 contactsToUpdate.Add(x);
                 break;
             case EntryState.Added:
                 _contactService.Create(x);
                 break;
         }
     });
     _contactService.Update(contactsToUpdate.ToArray());
 }
开发者ID:afandylamusu,项目名称:vc-community,代码行数:17,代码来源:CustomerExportImport.cs

示例3: UpdatePricelist

        private void UpdatePricelist(ICollection<Pricelist> original, ICollection<Pricelist> backup)
        {
            var toUpdate = new List<Pricelist>();

            backup.CompareTo(original, EqualityComparer<Pricelist>.Default, (state, x, y) =>
            {
                switch (state)
                {
                    case EntryState.Modified:
                        toUpdate.Add(x);
                        break;
                    case EntryState.Added:
                        _pricingService.CreatePricelist(x);
                        break;
                }
            });
            _pricingService.UpdatePricelists(toUpdate.ToArray());
        }
开发者ID:rajendra1809,项目名称:VirtoCommerce,代码行数:18,代码来源:PricingExportImport.cs

示例4: UpdateStores

        private void UpdateStores(ICollection<Store> original, ICollection<Store> backup)
        {
            var toUpdate = new List<Store>();

            backup.CompareTo(original, EqualityComparer<Store>.Default, (state, x, y) =>
            {
                switch (state)
                {
                    case EntryState.Modified:
                        toUpdate.Add(x);
                        break;
                    case EntryState.Added:
                        _storeService.Create(x);
                        break;
                }
            });
            _storeService.Update(toUpdate.ToArray());
        }
开发者ID:adwardliu,项目名称:vc-community,代码行数:18,代码来源:StoreExportImport.cs

示例5: UpdateOrders

        private void UpdateOrders(ICollection<CustomerOrder> original, ICollection<CustomerOrder> backup)
        {
            var toUpdate = new List<CustomerOrder>();

            backup.CompareTo(original, EqualityComparer<Operation>.Default, (state, x, y) =>
            {
                switch (state)
                {
                    case EntryState.Modified:
                        toUpdate.Add(x);
                        break;
                    case EntryState.Added:
                        _customerOrderService.Create(x);
                        break;
                }
            });
            _customerOrderService.Update(toUpdate.ToArray());
        }
开发者ID:rajendra1809,项目名称:VirtoCommerce,代码行数:18,代码来源:OrderExportImport.cs

示例6: UpdateCatalogProducts

		private void UpdateCatalogProducts(ICollection<CatalogProduct> original, ICollection<CatalogProduct> backup)
		{
			var toUpdate = new List<CatalogProduct>();

			backup.CompareTo(original, EqualityComparer<CatalogProduct>.Default, (state, x, y) =>
			{
				switch (state)
				{
					case EntryState.Modified:
						toUpdate.Add(x);
						break;
					case EntryState.Added:
						_itemService.Create(x);
						break;
				}
			});
			_itemService.Update(toUpdate.ToArray());
		}
开发者ID:nisarzahid,项目名称:vc-community,代码行数:18,代码来源:CatalogExportImport.cs

示例7: UpdateCoupons

        private void UpdateCoupons(ICollection<Coupon> original, ICollection<Coupon> backup)
        {
            var toUpdate = new List<Coupon>();

            backup.CompareTo(original, EqualityComparer<Coupon>.Default, (state, x, y) =>
            {
                switch (state)
                {
                    case EntryState.Modified:
                        toUpdate.Add(x);
                        break;
                    case EntryState.Added:
                        _promotionService.CreateCoupon(x);
                        break;
                }
            });
            _promotionService.UpdateCoupons(toUpdate.ToArray());
        }
开发者ID:adwardliu,项目名称:vc-community,代码行数:18,代码来源:MarketingExportImport.cs

示例8: UpdateContentFolders

 private void UpdateContentFolders(ICollection<DynamicContentFolder> original, ICollection<DynamicContentFolder> backup)
 {
     backup.CompareTo(original, EqualityComparer<DynamicContentFolder>.Default, (state, x, y) =>
     {
         switch (state)
         {
             case EntryState.Modified:
                 _dynamicContentService.UpdateFolder(x);
                 break;
             case EntryState.Added:
                 _dynamicContentService.CreateFolder(x);
                 break;
         }
     });
 }
开发者ID:adwardliu,项目名称:vc-community,代码行数:15,代码来源:MarketingExportImport.cs

示例9: UpdateContentPublications

        private void UpdateContentPublications(ICollection<DynamicContentPublication> original, ICollection<DynamicContentPublication> backup)
        {
            var toUpdate = new List<DynamicContentPublication>();

            backup.CompareTo(original, EqualityComparer<DynamicContentPublication>.Default, (state, x, y) =>
            {
                switch (state)
                {
                    case EntryState.Modified:
                        toUpdate.Add(x);
                        break;
                    case EntryState.Added:
                        _dynamicContentService.CreatePublication(x);
                        break;
                }
            });
            _dynamicContentService.UpdatePublications(toUpdate.ToArray());
        }
开发者ID:adwardliu,项目名称:vc-community,代码行数:18,代码来源:MarketingExportImport.cs


注:本文中的ICollection.CompareTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。