Created
March 2, 2022 23:10
-
-
Save sunnyy02/b9c4828581b501d2efa27e4904ed5eb3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
namespace AppointmentBot.CognitiveModels | |
{ | |
// Extends the partial DoctorBooking class with methods and properties that simplify accessing entities in the luis results | |
public partial class DoctorBooking | |
{ | |
public string Doctor | |
{ | |
get | |
{ | |
var doctorChosen = Entities?._instance?.Doctor?.FirstOrDefault()?.Text; | |
return doctorChosen; | |
} | |
} | |
// This value will be a TIMEX. And we are only interested in a Date so grab the first result and drop the Time part. | |
// TIMEX is a format that represents DateTime expressions that include some ambiguity. e.g. missing a Year. | |
public string AppointmentDate | |
=> Entities.datetime?.FirstOrDefault()?.Expressions.FirstOrDefault()?.Split('T')[0]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment