Update model database schema

This commit is contained in:
2023-04-16 15:08:15 +02:00
parent 0333e8a5c5
commit 6e0b59da4b
14 changed files with 232 additions and 72 deletions

View File

@ -38,10 +38,30 @@ namespace Elwig.Models {
public string? Birthday { get; set; }
[Column("entry_date")]
public string? EntryDate { get; set; }
public string? EntryDateString { get; set; }
[NotMapped]
public DateOnly? EntryDate {
get {
return EntryDateString != null ? DateOnly.ParseExact(EntryDateString, "yyyy-MM-dd") : null;
}
set {
EntryDateString = value?.ToString("yyyy-MM-dd");
}
}
[Column("exit_date")]
public string? ExitDate { get; set; }
public string? ExitDateString { get; set; }
[NotMapped]
public DateOnly? ExitDate {
get {
return ExitDateString != null ? DateOnly.ParseExact(ExitDateString, "yyyy-MM-dd") : null;
}
set {
ExitDateString = value?.ToString("yyyy-MM-dd");
}
}
[Column("business_shares")]
public int BusinessShares { get; set; }
@ -125,7 +145,7 @@ namespace Elwig.Models {
public virtual ISet<Contract> Contracts { get; private set; }
[InverseProperty("Member")]
public virtual BillingAddress BillingAddress { get; private set; }
public virtual BillingAddr BillingAddress { get; private set; }
public int SearchScore(IEnumerable<string> keywords) {
keywords = keywords.Where(s => s.Length >= 2 || (s.Length > 0 && s.All(c => char.IsDigit(c))));