Refactor and Fix PLZ/Ort in MemberListWindow

This commit is contained in:
2023-02-21 15:56:59 +01:00
parent a5d56a7c49
commit 71022c7fbf
14 changed files with 64 additions and 37 deletions

View File

@ -12,15 +12,15 @@ namespace WGneu.Models
public class PostalDest
{
[Column("country")]
public String CountryCode { get; set; }
public string CountryCode { get; set; }
[Column("id")]
public String Id { get; set; }
public string Id { get; set; }
[ForeignKey("CountryCode")]
public virtual Country Country { get; set; }
public AT_Plz? Plz(WGContext ctx)
public AT_Plz? Plz(WgContext ctx)
{
if (CountryCode != "AT") return null;
return ctx.Postleitzahlen.Where(p => p.Id == Id).FirstOrDefault();