WIP Member List

This commit is contained in:
2023-02-20 17:05:44 +01:00
parent a0ebecfe04
commit a5d56a7c49
22 changed files with 470 additions and 23 deletions

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WGneu.Models
{
[Table("postal_dest"), PrimaryKey("CountryCode", "Id")]
public class PostalDest
{
[Column("country")]
public String CountryCode { get; set; }
[Column("id")]
public String Id { get; set; }
[ForeignKey("CountryCode")]
public virtual Country Country { get; set; }
public AT_Plz? Plz(WGContext ctx)
{
if (CountryCode != "AT") return null;
return ctx.Postleitzahlen.Where(p => p.Id == Id).FirstOrDefault();
}
}
}