public async Task <List <Village> > GetVillagesByAutocompleteAsync(string villageName) { if (string.IsNullOrEmpty(villageName)) { return(new List <Village>()); } if (_isConnected) { var villages = await _socketRepository.GetVillagesByAutocomplete(villageName); UpdateVillages(villages); } using (var db = GetDBContext()) { return(db.Villages.Where(x => x.Name.StartsWith(villageName)).ToList()); } }