public async Task <Schedule> GetOrCreateScheduleAsync(HeadHunterVacancy headHunterVacancy) { if (headHunterVacancy.Schedule == null) { return(null); } return(_storageBroker.SelectAllSchedules().FirstOrDefault(s => s.Code.ToLower().Equals(headHunterVacancy.Schedule.Id.ToLower())) ?? await AddScheduleAsync(headHunterVacancy.Schedule)); }
public async Task <List <Schedule> > GetSchedulesAsync() { return(await _storageBroker.SelectAllSchedules().ToListAsync()); }