public object Put(PopularAddress request)
        {
            var command = new UpdatePopularAddress();

            Mapper.Map(request, command);
            command.Address.Id = request.Id;

            _commandBus.Send(command);

            return(new HttpResult(HttpStatusCode.OK));
        }
        public object Post(PopularAddress request)
        {
            var command = new AddPopularAddress();

            Mapper.Map(request, command);
            command.Address.Id = request.Id == Guid.Empty ? Guid.NewGuid() : request.Id;

            _commandBus.Send(command);

            return(new { command.Address.Id });
        }
        public object Delete(PopularAddress request)
        {
            var command = new RemovePopularAddress
            {
                Id        = Guid.NewGuid(),
                AddressId = request.Id
            };

            _commandBus.Send(command);

            return(new HttpResult(HttpStatusCode.OK));
        }
        public void UpdatePopularAddress(PopularAddress address)
        {
            var req = string.Format("/admin/popularaddresses/{0}", address.Id);

            Client.Put <string>(req, address);
        }
        public void AddPopularAddress(PopularAddress address)
        {
            var req = string.Format("/admin/popularaddresses");

            Client.Post <string>(req, address);
        }
        public Task Add(PopularAddress address)
        {
            var req = string.Format("/admin/popularaddresses");

            return(Client.PostAsync <object>(req, address));
        }