public EntityReference Create(Entity entity)
        {
            Throwers.IfNullArgument(entity, "entity");

            var id = this.services.Service.Create(entity);

            return(new EntityReference(entity.LogicalName, id));
        }
        public EntityReference CreatePriceList(string priceListName, EntityReference currencyId)
        {
            this.services.T.Trace("CreatePriceList...");

            Throwers.IfNullOrEmptyArgument(priceListName, "priceListName");
            Throwers.IfNullArgument(currencyId, "currencyId");
            Throwers.IfReferenceTypeIsWrong(currencyId, TransactionCurrency.EntityLogicalName);

            var newPriceLevel =
                new PriceLevel
            {
                Name = priceListName,
                TransactionCurrencyId = currencyId
            };

            var id = this.services.Service.Create(newPriceLevel);

            this.services.T.Trace("CreatePriceList!");

            return(new EntityReference(PriceLevel.EntityLogicalName, id));
        }
        public void Update(Entity entity)
        {
            Throwers.IfNullArgument(entity, "entity");

            this.services.Service.Update(entity);
        }