jabz ayuap
asked on
How can I set in mvc viewmodel my id if id = 0 and if id.hasvalue id = id.value
I have CrewPerVessel vess = new CrewPerVessel();
vess = _crewperVesselRepository.G etFirstIte m(x => x.CrewPerVesselId == crewpergroup.CrewId && x.EmployeeProfilePersonalD etail.Posi tion.Posit ionName == "Boat Captain");
and i have obj.id = (vess.id == null)? vess.id = 0 : obj.id = vess.id
after running the execution if i got object not reference to object and i know this code above obj.id = (vess.id == null)? vess.id = 0 : obj.id = vess.id makes my project stop. Can you help me guys if how can make this work?
vess = _crewperVesselRepository.G
and i have obj.id = (vess.id == null)? vess.id = 0 : obj.id = vess.id
after running the execution if i got object not reference to object and i know this code above obj.id = (vess.id == null)? vess.id = 0 : obj.id = vess.id makes my project stop. Can you help me guys if how can make this work?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.