42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace WGneu.Models
|
|
{
|
|
[Table("AT_plz"), PrimaryKey("Plz", "Okz"), Index("Id", IsUnique = true)]
|
|
public class AT_Plz
|
|
{
|
|
[Column("plz")]
|
|
public int Plz { get; set; }
|
|
|
|
[Column("okz")]
|
|
public int Okz { get; set; }
|
|
|
|
[Column("country")]
|
|
public String CountryCode { get; }
|
|
|
|
[Column("id")]
|
|
public String Id { get; }
|
|
|
|
[Column("dest")]
|
|
public String Dest { get; set; }
|
|
|
|
[ForeignKey("Okz")]
|
|
public virtual AT_Ort Ort { get; set; }
|
|
|
|
[ForeignKey("CountryCode")]
|
|
public virtual Country Country { get; set; }
|
|
|
|
public ISet<AT_Ort> Orte(WGContext ctx)
|
|
{
|
|
return ctx.Postleitzahlen.Where(p => p.Plz == Plz).Select(p => p.Ort).ToHashSet();
|
|
}
|
|
}
|
|
}
|