private async Task <SourceArea> AddSourceAreaAsync(SourceType sourceType, HeadHunterArea headHunterArea) { var area = _storageBroker.SelectAllAreas() .FirstOrDefault(item => item.Name.ToLower().Equals(headHunterArea.Name)) ?? await AddAreaAsync(headHunterArea); var sourceArea = new SourceArea { SourceId = headHunterArea.Id, AreaId = area.Id, SourceTypeId = sourceType.Id }; return(await _storageBroker.InsertSourceAreaAsync(sourceArea)); }
public Task <List <Area> > GetAreasAsync() { return(TryCatch(async() => await _storageBroker.SelectAllAreas().ToListAsync())); }