我是法國人,所以對不起,如果我的英語有時不確定... 我在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