WIP Member List
This commit is contained in:
41
WGneu/Models/AT_Plz.cs
Normal file
41
WGneu/Models/AT_Plz.cs
Normal file
@ -0,0 +1,41 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user