Created
December 2, 2015 22:14
-
-
Save samueleresca/1c71317ade033f99ba94 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MongoDB.Bson; | |
using System.ComponentModel.DataAnnotations; | |
using MongoDB.Bson.Serialization.Attributes; | |
namespace Blog.QueryingMongoDb.Models | |
{ | |
public class ContactModel | |
{ | |
[BsonId] | |
public ObjectId Id { get; set; } //MongoDb uses this field as identity. | |
[Required] | |
[Display(Name = "Name")] | |
public string NameSurname { get; set; } | |
[Required] | |
[DataType(DataType.EmailAddress)] | |
public string Email { get; set; } | |
[DataType(DataType.Url)] | |
public string Website { get; set; } | |
[DataType(DataType.MultilineText)] | |
public string Description { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment