Welcome to the Employee Management Web API! This API allows you to manage employees, departments, locations, and more using C# .NET with PostgreSQL. 🚀
✅ CRUD operations for Employees 👥
✅ Search Employees 🔍
✅ Database Integration (PostgreSQL) 🛢️
✅ RESTful API with Swagger 📜
✅ Secure and Scalable Architecture 🔒
✅ Added World's All Countries, States & Cities Data in It 🌍
- Backend: C# (.NET Core) 🖥️
- Database: PostgreSQL 🛢️
- ORM: Entity Framework Core 🔄
- API Documentation: Swagger 📜
- Environment: Visual Studio Code 💻
📦 EmployeeManagementAPI
┣ 📂 Controllers
┃ ┣ 📜 EmployeeController.cs
┣ 📂 Models
┃ ┣ 📜 Employee.cs
┃ ┣ 📜 Department.cs
┃ ┣ 📜 Country.cs
┃ ┣ 📜 State.cs
┃ ┣ 📜 City.cs
┣ 📂 Data
┃ ┣ 📜 ApplicationDbContext.cs
┃ ┣ 📜 countries+states+cities.json
┣ 📜 Program.cs
┣ 📜 appsettings.json
┣ 📂 Script
┃ ┣ 📜 insert_data.py
- Install .NET Core SDK
- Install PostgreSQL
- Install Visual Studio Code
# Clone the repository
git clone https://github.com/yourusername/EmployeeManagementAPI.git
cd EmployeeManagementAPI
# Install dependencies
dotnet restore
# Update database
dotnet ef database update
# Run the application
dotnet run
HTTP Method | Endpoint | Description |
---|---|---|
GET | /api/employees |
Get all employees |
POST | /api/employees |
Add a new employee |
PUT | /api/employees/{id} |
Update employee |
DELETE | /api/employees/{id} |
Delete employee |
GET | /api/employees/search?name=John |
Search employee by name |
🔹 Open your browser and go to:
👉 https://localhost:5001/swagger/index.html
💡 Contributions are welcome! Feel free to fork this repository and submit pull requests.
- Fork the repository
- Create a new branch (
feature/your-feature
) - Commit your changes
- Push to your branch
- Submit a pull request
🔗 GitHub: KrupalPatel17
🎉 Happy Coding! 🚀
Made with ❤️ by Krupal