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))); } }
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))); } }