Hi,
I have an Employee Class in which you have to capture the employee's physical and postal address.
Both the physical and postal address require a Province.
I have created a Province Class to store the Provinces.
I need to have a dropdown list of the Provinces for both the physical and postal address of a single employee but when I add the second dropdown list, it doesn't work.
My Employee Class is as follows;
My Province Class is;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
- using System.Web;
-
- namespace LMKSystem.Models
- {
- public class Province
- {
- [Key]
- public int ProvinceId { get; set; }
-
- [Display(Name = "Province")]
- public string SAProvince { get; set; }
- }
- }
My DbSet is as follows;
- public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
- {
- public DbSet<Employee> Employees { get; set; }
- public DbSet<Title> Titles { get; set; }
- public DbSet<Gender> Genders { get; set; }
- public DbSet<Group> Groups { get; set; }
- public DbSet<WorkPermit> WorkPermits { get; set; }
- public DbSet<Passport> Passports { get; set; }
- public DbSet<Language> Languages { get; set; }
- public DbSet<Marital> Maritals { get; set; }
- public DbSet<Province> Provinces { get; set; }
- }
How can I have one dropdown list for the postal address Province and one dropdown list for the physical address Province in the same class?
I am fairly new to dropdown lists.
Thanking you in advance.
Regards,
Kyle