Hello,
Welcome to Microsoft Q&A!
Serialing a List to JON creates empty string
The problem is FileName is internal getters/setters to prevent the user from accessing this functionality. If you want JsonConvert access to the internal functionality, you need add [JsonProperty] attribute for FileName proeprty
internal class Day30Model
{
[JsonProperty]
internal string FileName { get; set; }
}
And then call newton json JsonConvert
to serialize list items as string.
var jsonString = JsonConvert.SerializeObject(day30List);
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.