我是法国人,所以对不起,如果我的英语有时不确定... 我在6周的工作场所(我在这个领域相当新的.. .. 。),他们希望我将实际的数据库(json)转换为SQL中的实际服务器,并全部使用C#。我需要用C#读取JSON文件,将其转换为C#对象。阅读JSON文件与C#并将其转换成C#对象
还有就是JSON DB的例子:
{
"updated": "2015-05-20T13:16:00.000Z",
"title": "Chaîne Activité",
"description": "Vidéos des activités diverses du Webcenter",
"items": [
{
"id": "77B6573B-47E4-4D60-A6FC-99E81EF05404",
"uploaded": "2014-07-02T12:56:00.000Z",
"uploader": "Inconnu",
"category": "activité//Pléniére",
"title": "Teaser de la plénière 2014",
"description": "Marc Emmanuel de 'Tous Ensemble' et Axa Atout Coeur vous invite à la 3éme plénière.",
"thumbnail": "/Content/img/video/activite/teaser-pleniere-2014-.png",
"duration": 66,
"path": "Plénière-2014-teaser.mp4"
}`
,并有我的课:
public class Item
{
public string Id { get; set; }
public string UploadDate { get; set; }
public string Uploader { get; set; }
public string Category { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Thumbnail { get; set; }
public int Duration { get; set; }
public string Path { get; set; }
}
请记住,我不是一个专业的,感谢你的帮助! :)
那么你有什么累了吗? –
你想使用NewtonSoft Json nuget包来将JSON反序列化为你的对象。然后使用他们使用的任何数据库技术,无论是EF或ADO来获得它到数据库。 – Stuart
我现在拿着Newtonsoft,我会用ADO的“老板”看到 – MUGO