public IHttpActionResult CreatePriceList(webModel.Pricelist priceList)
        {
            var pricelist = _pricingService.CreatePricelist(priceList.ToCoreModel());
            var result    = pricelist.ToWebModel();

            return(Ok(result));
        }
Esempio n. 2
0
        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());
        }