Use CountryCode as PK
This commit is contained in:
@ -2,15 +2,15 @@ using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Elwig.Models {
|
||||
[Table("postal_dest"), PrimaryKey("CountryCode", "Id")]
|
||||
[Table("postal_dest"), PrimaryKey("CountryNum", "Id")]
|
||||
public class PostalDest {
|
||||
[Column("country")]
|
||||
public string CountryCode { get; private set; }
|
||||
public int CountryNum { get; private set; }
|
||||
|
||||
[Column("id")]
|
||||
public string Id { get; private set; }
|
||||
|
||||
[ForeignKey("CountryCode")]
|
||||
[ForeignKey("CountryNum")]
|
||||
public virtual Country Country { get; private set; }
|
||||
|
||||
[ForeignKey("Id")]
|
||||
|
Reference in New Issue
Block a user