Add Deliveries

This commit is contained in:
2023-04-27 23:34:58 +02:00
parent 15f999869a
commit 77781d227c
14 changed files with 278 additions and 12 deletions

View File

@ -35,6 +35,15 @@ namespace Elwig.Models {
[Column("suffix")]
public string? Suffix { get; set; }
public string Name =>
(Prefix != null ? Prefix + " " : "") +
GivenName + " " +
(MiddleName != null ? MiddleName + " " : "") +
FamilyName +
(Suffix != null ? " " + Suffix : "");
public string ShortName => GivenName + " " + FamilyName;
[Column("birthday")]
public string? Birthday { get; set; }
@ -153,6 +162,9 @@ namespace Elwig.Models {
[InverseProperty("Member")]
public virtual BillingAddr? BillingAddress { get; private set; }
[InverseProperty("Member")]
public virtual ISet<Delivery> Deliveries { get; private set; }
public int SearchScore(IEnumerable<string> keywords) {
keywords = keywords.Where(s => s.Length >= 2 || (s.Length > 0 && s.All(c => char.IsAsciiDigit(c))));
if (!keywords.Any())