KerelOlivier
2 years ago
1 changed files with 21 additions and 0 deletions
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
using MongoDB.Bson; |
||||
using MongoDB.Bson.Serialization.Attributes; |
||||
|
||||
namespace backend.Models; |
||||
|
||||
public class BlogPost |
||||
{ |
||||
[BsonId] |
||||
[BsonRepresentation(BsonType.ObjectId)] |
||||
public string? Id { get; set; } |
||||
|
||||
public string AuthorId { get; set; } |
||||
public string Title { get; set; } |
||||
public string Content { get; set; } |
||||
|
||||
//Meta data |
||||
[BsonRepresentation(BsonType.DateTime)] |
||||
public DateTime CreatedAt { get; set; } |
||||
|
||||
[BsonRepresentation(BsonType.Array)] public List<string> Tags { get; set; } |
||||
} |
Loading…
Reference in new issue