Skip to content

Instantly share code, notes, and snippets.

@tuannguyenssu
Created September 26, 2019 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuannguyenssu/1db6a78c7e5905855b2e12b7ac06b994 to your computer and use it in GitHub Desktop.
Save tuannguyenssu/1db6a78c7e5905855b2e12b7ac06b994 to your computer and use it in GitHub Desktop.
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace MongoDBTest.Models
{
public class Book
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; }
[BsonElement("Name")]
public string Name { get; set; }
public decimal Price { get; set; }
public string Category { get; set; }
public string Author { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment