Skip to content

The Countries List and Irans regions and divisions including a list of all provinces, cities, districts, counties, towns, and villages which you can search and access with LINQ syntax

License

Notifications You must be signed in to change notification settings

keyone2693/Iran.AspNet.CountryDivisions

Repository files navigation

Divisions of Iran

Iran.AspNet.CountryDivisions

‫ C# and ASP package to receive and search countries and Iran's provinces, cities, districts, counties, towns and villages and use in selections, dropdown list and also Api requests

Development

Build status NuGet GitHub issues GitHub stars GitHub license

Json Files: files

Current version: 2.1.x [Stable]

استان (ایران) شهرستان (ایران) بخش (ایران) شهر (ایران) دهستان (ایران) آبادی (ایران) کشور
۳۱ ۴۴۸ ۱۰۹۹ ۱۵۵۴/۱۳۵۴ ۲۶۳۷ ۹۸۱۰۰ 269

In this version: you can get all IRANS provinces, cities, districts, counties, towns and villages

or search for them

Also its includes countries list with their iso , domain , enName , faName , fips

--- there is no relation between tables

.net standard 2.0

Easy to install

Use the library as dll, reference from nuget or use this in your package manager console

Install-Package Iran.AspNet.CountryDivisions

After deploying your project be sure to give all permission to the Data Folder on your Server

Wiki

you only need to add two things

... Recomended ...

//Startup.cs
public void ConfigureServices(IServiceCollection services)
{
  //...
  services.AddIranCountryDivisions();
}
//Controller
private readonly IIranCountryDivisions _iranCountryDivisions;
public TestController(IIranCountryDivisions iranCountryDivisions)
{
  _iranCountryDivisions = iranCountryDivisions;
}

or :

  //...
  IIranCountryDivisions _iranCountryDivisions = new IranCountryDivisions(new Iran.AspNet.CountryDivisions.Data.DatabaseContext.LocationsDbContext());
  //...

then you can use it like this :

(تمام شهر ها داخل جدول شهرستان ها میباشد ، پس بهتر است همیشه با جدول شهرستان ها به عنوان لیست کامل شهر ها کار بکنید )

  //...
  var allOstans = await _iranCountryDivisions.GetOstansAsync();
  var ostansWithSearchAndOrderByAndCount = await _iranCountryDivisions.GetOstansAsync(p => p.Name.Contains(nameSearch), o=>o.OrderBy(p=>p.Name) , 10);
  
  
  var allAbadis = await _iranCountryDivisions.GetAbadisAsync();
  var abadisWithSearch = await _iranCountryDivisions.GetAbadisAsync(p => p.ShahrestanId == shahrId &&  p.Name.Contains(nameSearch));
  
  //...

same for others

Special thanks

Ahmad Azizi and his IRAN database

sh4rifi and his COUNTRIES database

the package will be updated base on their databases

About

The Countries List and Irans regions and divisions including a list of all provinces, cities, districts, counties, towns, and villages which you can search and access with LINQ syntax

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages