private async Task <Employment> GetOrCreateEmploymentAsync(HeadHunterVacancy headHunterVacancy) { if (headHunterVacancy.Employment == null) { return(null); } return(_storageBroker.SelectAllEmployments().FirstOrDefault(e => e.Code.ToLower().Equals(headHunterVacancy.Employment.Id.ToLower())) ?? await AddEmploymentAsync(headHunterVacancy.Employment)); }
public async Task <List <Employment> > GetEmploymentsAsync() { return(await _storageBroker.SelectAllEmployments().ToListAsync()); }