Skip to content

Slimcent/CountryRegion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CountryRegion A cascading dropdown for loading countries and associated states and local governments.

CountryRegion

A cascading dropdown for loading countries and associated states and local governments.

Badges

MIT License

stable release version: version

Nuget package downloads: downloads

Tech Stack

C#, .Net6.0, .NetStandard2.1,

How Do I Get Started

First, install NuGet. Then, install CountryRegion from the package manager console:

   NuGet\Install-Package CountryRegion -Version 1.0.10

This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.

Or from the .NET CLI as:

   dotnet add package CountryRegion --version 1.0.10

Finally, import into the file:

   using CountryRegion;

Features

  • Get all countries
  • Get all states
  • Get all local governments
  • Get a country
  • Get a state
  • Get a local government

Sample usage

   await Region.Countries();
  • Output
Type
Task<IEnumerable<Response?>>

   await Region.GetStates(countryId);
  • Input
Parameter Type Description
countryId int Required. The id of the country to get the states associated with it
  • Output
Type
Task<IEnumerable<Response?>>

   await Region.GetLGAs(countryId, stateId);
  • Input
Parameters Type Description
countryId, int Required. The id of the country to get the local governments from
stateId int Required. The id of the state to get the local governments from
  • Output
Type
Task<IEnumerable<Response?>>

   await Region.GetCountry(countryId);
  • Input
Parameter Type Description
countryId int Required. The id of the country to get
  • Output
Type
Task<Response?>

   await Region.GetState(countryId, stateId);
  • Input
Parameters Type Description
countryId, int Required. The id of the country to get a state from
stateId int Required. The id of the state to get
  • Output
Type
Task<Response?>

   await Region.GetLGA(stateId, lgaId);
  • Input
Parameters Type Description
stateId int Required. The id of the state to get local government from
lgaId int? Required. The name of the local government in that state
  • Output
Type
Task<Response?>

GetState Extension Method


   await Region.GetState(List<dynamic> objs, countryId, stateId);

Retrieves a specific state based on the provided parameters.

Input

Parameters Type Description
objs List<dynamic> Required. A list of objects representing the states.
countryId int Required. The ID of the country to retrieve the state from.
stateId int Required. The ID of the state to retrieve.

Output

Type
Response

GetLGA Extension Method


   await Region.GetLGA(List<dynamic> objs, stateId, lgaId);

Retrieves a specific Local Government Area (LGA) based on the provided parameters.

Input

Parameters Type Description
objs List<dynamic> Required. A list of objects representing the LGAs.
stateId int Required. The ID of the state to retrieve the LGA from.
lgaId int? The ID of the specific LGA to retrieve (optional). If not provided, its assumed the state has no LGA

Output

Type
Response

Thanks to all Contributors

Maintainers:

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages