mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.62k stars 1.25k forks source link

Autoincrement does not work only with Guid #1097

Closed beholdthelight closed 4 years ago

beholdthelight commented 6 years ago

Hi,

I've tried setting Id as int, ObjectId and Guid, but only Guid worked.

If I set Id to this: (in class "LiteDbLogEntry") public int Id { get; set; }

When the code hits this: logCollection.Insert(liteDbLogEntry);

I get this exception: An unhandled exception of type 'System.NullReferenceException' occurred in LiteDB.dll Additional information: Object reference not set to an instance of an object.

I get the same for ObjectId as well. Only GUID works.

lilasquared commented 6 years ago

the exception you have here is not consistent with autoincrement issues. Can you post some more code to show what exactly you are doing?

lbnascimento commented 4 years ago

Hi! With the objective of organizing our issues, we are closing old unsolved issues. Please check the latest version of LiteDB and open a new issue if your problem/question/suggestion still applies. Thanks!