Я бы порекомендовал создать класс, содержащий все свойства, и сериализовать класс в json, используя JSON.NET
. Вы можете установить JSON.NET через Nuget
PM> Install-Package Newtonsoft.Json
.создайте массив класса и заполните его всеми вашими записями
Затем вы можете использовать метод JsonConvert.SerialzeObject для создания Json
Вот мой код:
static void Main(string[] args)
{
ConversionMeta[] conversionMetaArray = new ConversionMeta[3];
conversionMetaArray[0] = new ConversionMeta()
{
Id = "deleted",
Name = "delete page from PDF",
Description = "You can delete any page from PDF blah blah..."
};
conversionMetaArray[1] = new ConversionMeta()
{
Id = "deleted",
Name = "delete page from PDF",
Description = "You can delete any page from PDF blah blah..."
};
conversionMetaArray[2] = new ConversionMeta()
{
Id = "deleted",
Name = "delete page from PDF",
Description = "You can delete any page from PDF blah blah..."
};
string json = JsonConvert.SerializeObject(conversionMetaArray);
}
Это класс:
class ConversionMeta
{
public string Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
И это вывод:
[
{"Id":"deleted","Name":"delete page from PDF","Description":"You can delete any page from PDF blah blah..."},
{"Id":"deleted","Name":"delete page from PDF","Description":"You can delete any page from PDF blah blah..."},
{"Id":"deleted","Name":"delete page from PDF","Description":"You can delete any page from PDF blah blah..."}
]