63 lines
1.4 KiB
C#
63 lines
1.4 KiB
C#
using ManagerService.DTOs;
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace ManagerService.Data
|
|
{
|
|
/// <summary>
|
|
/// User Information
|
|
/// </summary>
|
|
public class User
|
|
{
|
|
[Key]
|
|
[Required]
|
|
/*[BsonId]
|
|
[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]*/
|
|
public string Id { get; set; }
|
|
|
|
//[BsonElement("Email")]
|
|
//[BsonRequired]
|
|
[Required]
|
|
public string Email { get; set; } // UNIQUE !..
|
|
|
|
//[BsonElement("Password")]
|
|
//[BsonRequired]
|
|
[Required]
|
|
public string Password { get; set; }
|
|
|
|
//[BsonElement("FirstName")]
|
|
//[BsonRequired]
|
|
public string FirstName { get; set; }
|
|
|
|
//[BsonElement("LastName")]
|
|
//[BsonRequired]
|
|
[Required]
|
|
public string LastName { get; set; }
|
|
|
|
//[BsonElement("Token")]
|
|
//[BsonRequired]
|
|
[Required]
|
|
public string Token { get; set; }
|
|
|
|
//[BsonElement("DateCreation")]
|
|
public DateTime DateCreation { get; set; }
|
|
|
|
/*[BsonElement("InstanceId")]
|
|
[BsonRequired]*/
|
|
[Required]
|
|
public string InstanceId { get; set; }
|
|
|
|
public UserDetailDTO ToDTO()
|
|
{
|
|
return new UserDetailDTO()
|
|
{
|
|
id = Id,
|
|
email = Email,
|
|
firstName = FirstName,
|
|
lastName = LastName,
|
|
};
|
|
}
|
|
|
|
}
|
|
}
|