- .NET 8 SDK
- Microsoft.EntityFrameworkCore.Sqlite
- Bogus
| Method | Endpoint |
|---|---|
| GET | /api/products |
| GET | /api/products/{id} |
| POST | /api/products |
| PUT | /api/products/{id} |
| DELETE | /api/products/{id} |
- Add the class in Models (inherit EntityBase or add long Id property).
- Register the entity in the AppDbContext (modelBuilder.Entity();).
- (Optional) Implement IEntityFaker for the specific faker and register it in Services.
- In Program.cs, add
app.MapEntityEndpoints<YourEntity>("yourentities");
- The GenericRepository uses DbContext.Set() and FindAsync(id) to search by ID; if your entity uses a different pk name, adjust the repository.
- The DefaultEntityFaker attempts to populate common properties (string, number, DateTime). You can override it by registering a type-specific faker.
This project is licensed under the MIT License - see the LICENSE file for details.
Don't forget that if you find this project helpful, please give it a ⭐ on GitHub to show your support and help others discover it.