public static NetIncomeIntentWorker.QueryParameters Parse(IntentRequest request) { var qp = new NetIncomeIntentWorker.QueryParameters(); qp.Date = request.Intent.Slots["date"].Value == null ? (DateTime?)null : DateTime.Parse(request.Intent.Slots["date"].Value); qp.Year = request.Intent.Slots["year"].Value == null ? (int?)null : int.Parse(request.Intent.Slots["year"].Value); return(qp); }
public static NetIncomeIntentWorker.QueryParameters Parse(RecognizerResult result) { var qp = new NetIncomeIntentWorker.QueryParameters(); qp.Year = result.Entities.ContainsKey("datetime") ? int.Parse((string)result.Entities["datetime"].First()["timex"].First()) : (int?)null; return(qp); }