public T?ProcessActionResult(string?responseJson, Enum theAction)
        {
            var accAct = new AccountActivity();

            if ((AccountActivityType)theAction == AccountActivityType.Webhooks)
            {
                accAct.WebhooksValue =
                    new WebhooksValue
                {
                    Webhooks =
                        new Webhook?[]
                    {
                        string.IsNullOrWhiteSpace(responseJson) ?
                        new Webhook() :
                        JsonSerializer.Deserialize <Webhook>(responseJson)
                    }
                }
            }
            ;
            else if ((AccountActivityType)theAction == AccountActivityType.Subscriptions)
            {
                accAct.SubscriptionValue = new SubscriptionValue {
                    IsSubscribed = true
                }
            }
            ;

            return(accAct.ItemCast(default(T)));
        }
    }
Exemplo n.º 2
0
        public T ProcessActionResult(string responseJson, Enum theAction)
        {
            var accAct = new AccountActivity();

            if ((AccountActivityType)theAction == AccountActivityType.Webhooks)
            {
                accAct.WebhooksValue =
                    new WebhooksValue
                {
                    Webhooks =
                        new Webhook[]
                    {
                        responseJson == null ?
                        new Webhook() :
                        JsonConvert.DeserializeObject <Webhook>(responseJson)
                    }
                }
            }
            ;
            else if ((AccountActivityType)theAction == AccountActivityType.Subscriptions)
            {
                accAct.SubscriptionValue = new SubscriptionValue {
                    IsSubscribed = true
                }
            }
            ;

            return(accAct.ItemCast(default(T)));
        }
    }