public async Task AddAvailability(ConsultationDTO dto) { var ConsultantAvailability = new ConsultantAvailability(); ConsultantAvailability.ConsultationRequestId = dto.DomainModel.Id; ConsultantAvailability.ConsultantEmail = dto.DomainModel.ConsultantEmail; ConsultantAvailability.StartDate = dto.DomainModel.DateFrom; ConsultantAvailability.EndDate = dto.DomainModel.DateTo; ConsultantAvailability.Days = dto.DomainModel.Duration; ConsultantAvailability.Year = DateTime.Parse(ConsultantAvailability.StartDate.ToString()).Year;; await _availabilityservice.AddNewRequest(ConsultantAvailability); }
public async Task DeleteAvailability(ConsultationDTO dto) { var ConsultantAvailability = new ConsultantAvailability(); var ConsultantAvailabilityItem = _availabilityservice.Find(x => x.ConsultationRequestId == dto.DomainModel.Id).FirstOrDefault(); await _availabilityservice.DeleteRequest(ConsultantAvailabilityItem); }