34 lines
849 B
C#
34 lines
849 B
C#
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using NewsBlogAbstractions.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace NewsBlogMongoDB.Models
|
|
{
|
|
public class CommentMongo
|
|
{
|
|
[BsonId]
|
|
[BsonRepresentation(BsonType.ObjectId)]
|
|
public string Id { get; set; }
|
|
public string Title { get; set; } = string.Empty;
|
|
public string Content { get; set; } = string.Empty;
|
|
public string Create_date { get; set; } = string.Empty;
|
|
public string Article_id { get; set; } = string.Empty;
|
|
|
|
public CommentMongo(NewsBlogAbstractions.Models.Comment model, string ArticleId)
|
|
{
|
|
Title = model.Title;
|
|
Content = model.Content;
|
|
Create_date = model.CreateDate.ToString("d");
|
|
Article_id = ArticleId;
|
|
}
|
|
public CommentMongo()
|
|
{
|
|
}
|
|
}
|
|
}
|