You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you do? Trying to use a JSON object that has been deserialized into C# classes
What happened? Using getter/setters causes errors with trying to decorate the columns.
Okay:
[Column("0")]
public string Label;
Not okay:
[Column("0")]
public string Label { get; set; }
What did you expect? To be able to use getter/setters. Without them, it makes everything a PITA
Source code / logs
Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.
Class I am using to deserialize:
public class Intent
{
[Column("0")]
[ColumnName("Label")]
public string Label;
[Column("1")]
public List<string> Patterns = new List<string>();
}
Loading in intent data with this:
public static class IntentLoader
{
public static List<Intent> LoadIntentData()
{
var fileContents = System.IO.File.ReadAllText("intents.json");
try
{
var intents = JsonConvert.DeserializeObject<List<Intent>>(fileContents);
return intents;
}
catch (Exception e)
{
throw e;
}
}
}
The text was updated successfully, but these errors were encountered:
System information
Issue
What did you do? Trying to use a JSON object that has been deserialized into C# classes
What happened? Using getter/setters causes errors with trying to decorate the columns.
Okay:
[Column("0")]
public string Label;
Not okay:
[Column("0")]
public string Label { get; set; }
What did you expect? To be able to use getter/setters. Without them, it makes everything a PITA
Source code / logs
Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.
Class I am using to deserialize:
Loading in intent data with this:
The text was updated successfully, but these errors were encountered: