Merged
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using LinqToDB.Mapping;
|
||||
using Newtonsoft.Json;
|
||||
using SeniorAssistant.Models.Users;
|
||||
|
||||
namespace SeniorAssistant.Models
|
||||
{
|
||||
@@ -8,17 +9,29 @@ namespace SeniorAssistant.Models
|
||||
[Column(IsPrimaryKey = true, CanBeNull = false)]
|
||||
public string Username { get; set; }
|
||||
|
||||
[NotNull]
|
||||
[Column(CanBeNull = false)]
|
||||
public string Email { get; set; }
|
||||
|
||||
[NotNull]
|
||||
[JsonIgnore]
|
||||
[Column(CanBeNull = false)]
|
||||
public string Password { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
public string LastName { get; set; }
|
||||
|
||||
public string Avatar { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[Association(ThisKey = nameof(Username), OtherKey = nameof(Doctor.Username), CanBeNull = true)]
|
||||
public Doctor Doc { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[Association(ThisKey = nameof(Username), OtherKey = nameof(Patient.Username), CanBeNull = true)]
|
||||
public Patient Pat { get; set; }
|
||||
|
||||
public bool IsDoctor() => Doc != null;
|
||||
|
||||
public bool IsPatient() => Pat != null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user