/// <summary> /// Maps object data from <see cref="VacationDto"/> to <see cref="Vacation"/>. /// </summary> /// <param name="vacation">The <see cref="Vacation"/> instance containing data.</param> /// <returns>The <see cref="Vacation"/> instance.</returns> public Vacation MapTo(Vacation entity = null) { Vacation vacation = entity; if (vacation == null) { vacation = new Vacation(); } vacation.ID = ID; vacation.DateFrom = DateFrom.GetValueOrDefault(); vacation.DateTo = DateTo.GetValueOrDefault(); vacation.TypeID = Type.GetValueOrDefault(); vacation.StatusID = Status.GetValueOrDefault(); vacation.AvailabilityID = Availability.GetValueOrDefault(); vacation.Active = Active.GetValueOrDefault(); return(vacation); }