Adding structure to responses

This commit is contained in:
kdeng00
2023-09-29 19:09:17 -04:00
parent 192208fe2a
commit 4c232a500d
4 changed files with 62 additions and 20 deletions
+8 -5
View File
@@ -1,10 +1,6 @@
using System;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Conventions;
using MongoDB.Bson.Serialization.IdGenerators;
using MongoDB.Driver;
using Newtonsoft.Json;
namespace TextSender_API.Models;
@@ -13,18 +9,25 @@ public class User
#region Properties
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
[JsonProperty("id")]
public string? Id { get; set; }
[BsonElement("firstname")]
[JsonProperty("firstname")]
public string? Firstname { get; set; }
[BsonElement("lastname")]
[JsonProperty("lastname")]
public string? Lastname { get; set; }
[BsonElement("phonenumber")]
[JsonProperty("phone_number")]
public string? PhoneNumber { get; set; }
[BsonElement("username")]
[JsonProperty("username")]
public string? Username { get; set; }
[BsonElement("password")]
[JsonProperty("password")]
public string? Password { get; set; }
[BsonElement("datecreated")]
[JsonProperty("date_created")]
public DateTime? DateCreated { get; set; }
#endregion
}