我目前正在開發基於論壇(問題/答案)的應用程序。
使用C#ASP.net MVC和MongoDB進行數據存儲。使用C#/ ASP.net建模NoSQL論壇應用程序MVC
我目前正在看模型。
我想有這樣不同的類中:(簡體)
public class Question
{
public string ID { get; set; }
public string Title { get; set; }
public string Body { get; set; }
public List<string> Tags { get; set; }
public DateTime DateCreated { get; set; }
public string ForumID { get; set; }
}
回答
public class Answer
{
public string ID { get; set; }
public string QuestionID { get; set; }
public string Body { get; set; }
public DateTime DateCreated { get; set; }
}
我的問題是:
如何處理「的答覆」
我是最具有(如上述模型)兩個單獨的「實體」
或者我應該在我的問題模型中有一個答案列表?
有些要求是,我需要能夠顯示答案等的個性化......
有了這個被存儲在NoSQL的分貝,我知道我應該非規範化的東西,卻怎麼也我插入一個答案,沒有檢索整個帖子? NoRM與MongoDB一起使用是否可行?