Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created September 29, 2017 15: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 NMZivkovic/e6f798baa77e196e3bff75c3b6576160 to your computer and use it in GitHub Desktop.
Save NMZivkovic/e6f798baa77e196e3bff75c3b6576160 to your computer and use it in GitHub Desktop.
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace MongoDb
{
/// <summary>
/// Class used in business logic to represent user.
/// </summary>
public class User
{
[BsonId]
public ObjectId Id { get; set; }
[BsonElement("name")]
public string Name { get; set; }
[BsonElement("blog")]
public string Blog { get; set; }
[BsonElement("age")]
public int Age { get; set; }
[BsonElement("location")]
public string Location { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment