You're creating two separate DbContext
objects. Try adding just one:
public class MyDbContext: DbContext
{
public DbSet<Device> Devices {get; set;}
public DbSet<DeviceDictionary> Dictionaries { get; set; }
}
The Context must reference both Classes so that it knows about their existence. This way it can do its work, that is, set references between those classes using foreign keys.