Q:

Can't implicitly convert int to model type

Hi I have two model classes for technician and profession I gave relationship to the tables by crating profession foreign key column I want to create Dropdownlist with that foreign key column when I map this model to SqlReader for insert function  I've got error like cannot implicitly convert int to model.profession. 
model code :  
public class Technician
{   
     [ScaffoldColumn (false)]
     public int Id { get; set; }

     [Required]
     [Display(Name = "Name")]
     public string Name { get; set; }

     [Required]
     public Profession Profession { get; set; }

}

public class Profession
{
    [Key]
    public int ProfessionId { get; set; }
    public string ProfessionType { get; set; }
}

Db class code :
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
    Technician technician = new Technician();
    technician.Id = Convert.ToInt32(dr["techId"]);

    technician.Name = dr["techName"].ToString();

    technician.Profession = Convert.ToInt32(dr["primeProfessionId"]);
    Jobtechnicians.Add(technician);`
}

A:

Error is very clear here. cannot implicitly convert int to model.profession Compiler says it doesn't know how to convert an Int32 to Profession.
technician.Profession = Convert.ToInt32(dr["primeProfessionId"]);

In the above line you're trying to set int value to Profession.
I assume Profession is a class. So you've to set instance of Profession there.
Somthing like this
technician.Profession = FindProfessionByProfessionId(Convert.ToInt32(dr["primeProfessionId"]));

private Profession FindProfessionByProfessionId(int professionId)
{
    //find profession instance or create one and return here 
} 

