3
私のlitedbデータベースファイルにconsole.writelineデータがどのように格納されているのだろうか。 これは私がデシベルでINFOMATION挿入私のPOCOクラスLiteDBからのデータ取得
あり[BsonId]
public int Id { get; set; }
public DateTime Updated { get; set; }
public DateTime Last { get; set; }
public override string ToString()
{
return string.Format("Id : {0}, Updated : {1}, Last Message : {2}",
Id,
Updated,
Last);
}
です:
using (var db = new LiteDatabase(_dbLocation))
{
var hist = db.GetCollection<MailBoxInfo>("History");
var mail = new MailBoxInfo
{
Updated = DateTime.Now,
Last = datemsg
};
hist.Insert(mail);
hist.EnsureIndex("Updated");
}
をそして、最終的には、出力にそれを試してみてください。
using (var db = new LiteDatabase(_dbLocation))
{
var hist = db.GetCollection<MailBoxInfo>("History");
var res = hist.FindById(3);
}
その後、私は例外
取得私が間違っています"追加情報:作成に失敗しましたインスタンス「 'TanganTask.MailBoxInfo'」を検索しました。 「なし パラメータを持つpublicコンストラクタを持っているかどうかをチェックします。
と、この問題を解決するためにどのように?
ありがとうあなたが最も参考になってきました! – Veotani