public async Task <IActionResult> PutAsync(int id, [FromBody] SaveSubscriptionPlanResource resource)
        {
            var subscriptionPlan = _mapper.Map <SaveSubscriptionPlanResource, SubscriptionPlan>(resource);
            var result           = await _subscriptionPlanService.UpdateAsync(id, subscriptionPlan);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            var subscriptionPlanResource = _mapper.Map <SubscriptionPlan, SubscriptionPlanResource>(result.Resource);

            return(Ok(subscriptionPlanResource));
        }
        public async Task <IActionResult> PostAsync([FromBody] SaveSubscriptionPlanResource resource)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState.GetMessages()));
            }
            var subscriptionPlan = _mapper.Map <SaveSubscriptionPlanResource, SubscriptionPlan>(resource);
            var result           = await _subscriptionPlanService.SaveAsync(subscriptionPlan);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            var subscriptionPlanResource = _mapper.Map <SubscriptionPlan, SubscriptionPlanResource>(result.Resource);

            return(Ok(subscriptionPlanResource));
        }