1
I am doing a job of the facul that is for control of fleet of vehicles, I created a class Travel and I tried to put the classes Driver and Vehicle in this class.
public Motorista {get; set;}
public Veiculo {get; set;}
Created a registration screen for travel and in the command Insert I did so:
Viagens viagens = new Viagens();
viagens.Motorista.CPF = txtCPF.Text;
viagens.Veiculo.Placa = txtPlaca.Text;
bll.InsertViagem(viagens);
But when doing Insert I get an error "Object reference not defined for an object instance"
What do I have to do to make this mistake? Because my Travel class needs the CPF of the Driver class and the Vehicle License Plate class, I thought that this way employee, but not... I’ll be very grateful if someone helps.
Understood the solution?
– novic