Fix Models with PLZ
This commit is contained in:
@ -1,11 +1,5 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WGneu.Helpers;
|
||||
|
||||
namespace WGneu.Models {
|
||||
[Table("postal_dest"), PrimaryKey("CountryCode", "Id")]
|
||||
@ -19,10 +13,7 @@ namespace WGneu.Models {
|
||||
[ForeignKey("CountryCode")]
|
||||
public virtual Country Country { get; set; }
|
||||
|
||||
public AT_Plz? Plz(AppDbContext ctx) {
|
||||
// TODO getter
|
||||
if (CountryCode != "AT") return null;
|
||||
return ctx.Postleitzahlen.Where(p => p.Id == Id).FirstOrDefault();
|
||||
}
|
||||
[ForeignKey("Id")]
|
||||
public virtual AT_PlzDest? AtPlz { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user