Before you can run this project, make sure you have the following installed:
- .NET SDK (v6.0 or higher)
- SQL Server (or another supported database system)
- Microsoft SQL Server Management Studio (SSMS) (optional, for managing SQL Server)
- Postman (optional, for testing API endpoints)
- Microsoft.EntityFrameworkCore - Core EF functionality.
- Microsoft.EntityFrameworkCore.SqlServer - EF Core provider for SQL Server.
- Microsoft.EntityFrameworkCore.Tools - Tools for EF Core, used for migrations and scaffolding.
- Microsoft.AspNetCore.Authentication.JwtBearer - For JWT authentication.
- Clone the Repository:
- Navigate to the Project Directory:
cd yourproject
- Set Up the Database:
Update the connection string in the GreenGoDbContext File to point to your SQL Server instance or your chosen database system.
// This is a Connection String Example
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Server = . ; Database = GreenGo ; Trusted_Connection =true; TrustServerCertificate = true");
}
- Run Database Migrations (if using EF Core):
- Write The Command: (Updade-DataBase) In The Project Manger Console