API developed to manage product information.
- ASP.NET 8
- PostgreSQL 16
- MemoryCache
- FluentResult
- FluentValidation
- Entity Framework
| There is already an database configured in the project, but if you want to create a new one, remember to update the connection string in the appsettings files and run migrations.
- Clone the repository:
git clone https://github.com/predodamiao/Product-api
cd Product-api
- Build and Run the API with cli:
dotnet run
- Access the API at http://localhost:80.
The database is created using Entity Framework Core's "Code First" approach. This means that the database is automatically generated based on the domain models defined in the project.
To create a new migration, run the following commands:
dotnet ef migrations add <migration name> --project .\Infrastructure --startup-project .\Api -o .\Database\Migrations
To run the migrations and create the database, run the following commands:
dotnet ef database update --project .\Infrastructure --startup-project .\Api
- API: Controllers and configuration of the ASP.NET Core application.
- Service: Business logic and application services.
- Infrastructure: Infrastructure implementation, including database access.
- Domain: Domain models.
- Tests.Unit: Unit tests.