Able to create and read data from the DB

This commit is contained in:
kdeng00
2023-09-26 06:28:45 -04:00
parent b8a9142f05
commit 8f090bd2e2
5 changed files with 63 additions and 9 deletions
+4 -2
View File
@@ -2,6 +2,7 @@ using System;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Conventions;
using MongoDB.Driver;
namespace TextSender_API.Models;
@@ -9,8 +10,9 @@ namespace TextSender_API.Models;
public class User
{
#region Properties
// [BsonElement("_id")]
public ObjectId Id { get; set; }
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string? Id { get; set; }
[BsonElement("firstname")]
public string? Firstname { get; set; }
[BsonElement("lastname")]