I am getting error like Object reference not set to an instance of an object.
But while debugging I see value is coming perfectly in variable, so any idea why still this error is coming.
please see below image and below code also.
var vipAppointmentType = await _codeTypeRepository.GetCodeSetsAsQueryable()
.FirstOrDefaultAsync(c => c.Id == entity.VIPTypeId);
var dto = ViewVipAppointmentTypeDto.Create(
entity.Id,
entity.Code,
entity.Description,
vipAppointmentType.Name,
entity.IsFreeMembership);
dto.VipType.Id = vipAppointmentType.Id;
dto.VipType.Name = vipAppointmentType.Name;
dto.VipType.AbbreviationCode = vipAppointmentType.AbbreviationCode;