54 lines
1.2 KiB
C#
54 lines
1.2 KiB
C#
using Manager.Interfaces.DTO;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Manager.Interfaces.Models
|
|
{
|
|
/// <summary>
|
|
/// User Information
|
|
/// </summary>
|
|
public class User
|
|
{
|
|
[BsonId]
|
|
[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
|
|
public string Id { get; set; }
|
|
|
|
[BsonElement("Email")]
|
|
[BsonRequired]
|
|
public string Email { get; set; } // UNIQUE !..
|
|
|
|
[BsonElement("Password")]
|
|
[BsonRequired]
|
|
public string Password { get; set; }
|
|
|
|
[BsonElement("FirstName")]
|
|
[BsonRequired]
|
|
public string FirstName { get; set; }
|
|
|
|
[BsonElement("LastName")]
|
|
[BsonRequired]
|
|
public string LastName { get; set; }
|
|
|
|
[BsonElement("Token")]
|
|
[BsonRequired]
|
|
public string Token { get; set; }
|
|
|
|
[BsonElement("DateCreation")]
|
|
public DateTime DateCreation { get; set; }
|
|
|
|
public UserDetailDTO ToDTO()
|
|
{
|
|
return new UserDetailDTO()
|
|
{
|
|
id = Id,
|
|
email = Email,
|
|
firstName = FirstName,
|
|
lastName = LastName,
|
|
};
|
|
}
|
|
|
|
}
|
|
}
|