public static GrossIncomeIntentWorker.QueryParameters Parse(IntentRequest request) { var qp = new GrossIncomeIntentWorker.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 GrossIncomeIntentWorker.QueryParameters Parse(RecognizerResult result) { var qp = new GrossIncomeIntentWorker.QueryParameters(); qp.Year = result.Entities.ContainsKey("datetime") ? int.Parse((string)result.Entities["datetime"].First()["timex"].First()) : (int?)null; return(qp); }