21 lines
442 B
C#
21 lines
442 B
C#
using System;
|
|
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
namespace APITest2.Models;
|
|
|
|
public class Book
|
|
{
|
|
[BsonId]
|
|
[BsonRepresentation(BsonType.ObjectId)]
|
|
public string? Id { get; set; }
|
|
|
|
[BsonElement("Name")]
|
|
public string BookName { get; set; } = null!;
|
|
|
|
public decimal Price { get; set; }
|
|
|
|
public string Category { get; set; } = null!;
|
|
|
|
public string Author { get; set; } = null!;
|
|
} |