Add alias and display name to document people.

This commit is contained in:
2019-06-30 22:37:03 +01:00
parent 3e03c962fa
commit b4b01ce2e2
6 changed files with 8254 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -9,15 +10,19 @@ namespace Cicm.Database.Models
[Required]
public string Name { get; set; }
[Required]
public string Surname { get; set; }
public int? PersonId { get; set; }
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}";
public virtual Person Person { get; set; }
public virtual ICollection<PeopleByDocument> Documents { get; set; }
public virtual ICollection<PeopleByBook> Books { get; set; }
public virtual ICollection<PeopleByMagazine> Magazines { get; set; }
[NotMapped]
public string FullName => $"{Name} {Surname}";
}
}