Skip to content

Instantly share code, notes, and snippets.

@tuannguyenssu
Created September 26, 2019 14:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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