c# - MongoDB - document is adding with luuid -


i have problem add document collection c#.

i have model in program

public class object {     public guid id { get; set; }     public long starttimestamp { get; set; }     public long endtimestamp { get; set; } } 

and problem in database. documents saveing luuid no csuuid , cannot eg. find id

try use string type c# object, serialization attribute:

using mongodb.bson; using mongodb.bson.serialization.attributes;      public class object {     [bsonrepresentation(bsontype.objectid)]     public string id { get; set; }      public long starttimestamp { get; set; }      public long endtimestamp { get; set; } } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -