2019-06-17 00:34:54 +01:00
|
|
|
using System.Collections.Generic;
|
2019-06-30 22:37:03 +01:00
|
|
|
using System.ComponentModel;
|
2019-06-17 00:28:17 +01:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
2020-02-10 02:10:18 +00:00
|
|
|
namespace Marechai.Database.Models
|
2019-06-17 00:28:17 +01:00
|
|
|
{
|
|
|
|
|
public class DocumentPerson : BaseModel<int>
|
|
|
|
|
{
|
|
|
|
|
[Required]
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
[Required]
|
2019-06-30 22:37:03 +01:00
|
|
|
public string Surname { get; set; }
|
|
|
|
|
public int? PersonId { get; set; }
|
|
|
|
|
public string Alias { get; set; }
|
|
|
|
|
[DisplayName("Name to be displayed")]
|
|
|
|
|
public string DisplayName { get; set; }
|
|
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
[DisplayName("Name")]
|
|
|
|
|
public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}";
|
2019-06-17 00:28:17 +01:00
|
|
|
|
2019-06-30 22:51:08 +01:00
|
|
|
[DisplayName("Linked person")]
|
|
|
|
|
public virtual Person Person { get; set; }
|
2019-06-17 00:34:54 +01:00
|
|
|
public virtual ICollection<PeopleByDocument> Documents { get; set; }
|
2019-06-17 03:02:47 +01:00
|
|
|
public virtual ICollection<PeopleByBook> Books { get; set; }
|
2019-06-17 04:10:14 +01:00
|
|
|
public virtual ICollection<PeopleByMagazine> Magazines { get; set; }
|
2019-06-17 00:28:17 +01:00
|
|
|
}
|
|
|
|
|
}
|