public async Task DeleteSubscription(Guid subscriptionId)
 {
     using (var client = new SubscriptionManagementClient())
     {
         await client.DeleteSubscriptionAsync(subscriptionId);
     }
 }
        public async Task <IEnumerable <DtoResponse.SubscriptionData> > GetSubscriptions()
        {
            using (var client = new SubscriptionManagementClient())
            {
                var subscriptions = await client.GetSubscriptionsAsync();

                return(subscriptions.Select(user => MapSubscriptionFields(user)));
            }
        }
        public async Task <DtoResponse.SubscriptionData> GetSubscriptionById(Guid id)
        {
            using (var client = new SubscriptionManagementClient())
            {
                var subscription = await client.GetSubscriptionByIdAsync(id);

                return(MapSubscriptionFields(subscription));
            }
        }
 public async Task UpdateSubscription(Guid subcriptionId, Dto.UpdateSubscription request)
 {
     using (var client = new SubscriptionManagementClient())
     {
         var requestData = new UpdateSubscription()
         {
             SubcriptionId = subcriptionId, Name = request.Name, Callminutes = request.Callminutes, Price = request.Price, PriceIncVatAmount = request.PriceIncVatAmount
         };
         await client.UpdateSubscriptionAsync(requestData);
     }
 }
        public async Task <DtoResponse.CreateSubscriptionResponse> CreateSubscription(Dto.CreateSubscription request)
        {
            using (var client = new SubscriptionManagementClient())
            {
                var requestData = new CreateSubcription()
                {
                    Name = request.Name, Callminutes = request.Callminutes, Price = request.Price, PriceIncVatAmount = request.PriceIncVatAmount
                };
                var response = await client.CreateSubscriptionAsync(requestData);

                return(new DtoResponse.CreateSubscriptionResponse()
                {
                    Id = response.Id
                });
            }
        }