litedb

Collection.Find(…), Collection.FindAll() All throwing exception with message “value can not be null parameter name method”

孤街醉人 提交于 2021-01-29 12:50:31
问题 Person Model: public class Person { public Int32 Id { get; set; } public String Name { get; set; } } Find Person from DB: public List<Person> find() { using (var db = new LiteDatabase(DatabasePathProvider.CacheLiteDbPath)) { var col = db.GetCollection<Person>("Person"); var list = col.FindOne(m => m.Name != null); return list; } } On executing the find query on the database as shown in the code, This exception is thrown with stack trace: at System.Dynamic.Utils.ContractUtils.RequiresNotNull

How to Join In LiteDb

不羁的心 提交于 2020-07-22 09:33:24
问题 How can i join between two table in LiteDb Like SQL Example : I Have Two table User and ActivityLog Here is the Model public class ActivityLog { [BsonId] public int Id { get; set; } public string UserId { get; set; } public string Action { get; set; } public DateTime ActionDateTime { get; set; } } public class User { [BsonId] public int Id { get; set; } public string UserId { get; set; } public string UserName { get; set; } public DateTime LoginDate { get; set; } } I need to join Activity

LiteDB: Invalid BSON data type 'Null' on field '_id'

南笙酒味 提交于 2019-12-01 01:46:15
问题 Using LiteDB, and it is amazing. It works well for loading and storing data, however, not on subsequent loads after the database has been created. On initial load, everything is perfect. It creates the database and stores the new record flawlessly, and query returns empty since nothing exists in that collection yet. On subsequent load, after querying the data (works and gets the result), there is a problem in the .Update() which is causing this issue. According to their documentation, when an