36 lines
1017 B
C#
36 lines
1017 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using IndexAttribute = Microsoft.EntityFrameworkCore.IndexAttribute;
|
|
|
|
namespace Elwig.Models.Entities {
|
|
[Table("AT_plz_dest"), PrimaryKey("Id"), Index("Plz", "Okz", IsUnique = true)]
|
|
public class AT_PlzDest {
|
|
[Column("plz")]
|
|
public int Plz { get; init; }
|
|
|
|
[Column("okz")]
|
|
public int Okz { get; init; }
|
|
|
|
[Column("country")]
|
|
public int CountryNum { get; init; }
|
|
|
|
[Column("id")]
|
|
public required string Id { get; init; }
|
|
|
|
[Column("dest")]
|
|
public required string Dest { get; init; }
|
|
|
|
[NotMapped]
|
|
public string FullDest => $"{Ort.Name} ({Dest})";
|
|
|
|
[ForeignKey("Plz")]
|
|
public virtual AT_Plz AtPlz { get; init; } = null!;
|
|
|
|
[ForeignKey("Okz")]
|
|
public virtual AT_Ort Ort { get; init; } = null!;
|
|
|
|
[ForeignKey("CountryNum")]
|
|
public virtual Country Country { get; init; } = null!;
|
|
}
|
|
}
|