Adding structure to responses
This commit is contained in:
+8
-5
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user