WIP Member List
This commit is contained in:
29
WGneu/Models/PostalDest.cs
Normal file
29
WGneu/Models/PostalDest.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user