Beispiel #1
0
        public CallViewModel UpdateCallPrice(CallViewModel data)
        {
            var call = callsRepository.FindByFromToAreaCode(
                data.FromAreaCode, data.ToAreaCode
                );

            if (call == null)
            {
                throw new FaleMaisException(
                          "There is no call price registered for these area codes",
                          404
                          );
            }

            call.PricePerMinute = data.PricePerMinute;
            callsRepository.SaveChanges();

            return(mapper.Map <CallViewModel>(call));
        }