This project is a basic CRUD application built using ASP.NET Core. It demonstrates how to use dotnet watch
for improved development speed and how to utilize Docker for containerization.
The project consists of the following main components:
-
src/DotnetWatchDemo.Api: The API project containing the controllers, models, and data access layer.
- Controllers: Contains the
ItemsController
which handles HTTP requests for item management. - Models: Contains the
Item
model representing the data structure for items. - Data: Contains the
ApplicationDbContext
for database interactions andDbInitializer
for seeding initial data. - Program.cs: The entry point of the application.
- appsettings.json: Configuration settings for the application.
- appsettings.Development.json: Development-specific configuration settings.
- Controllers: Contains the
-
docker-compose.yml: Defines the services and configurations for running the application in Docker.
-
.dockerignore: Specifies files and directories to be ignored by Docker during the build process.
- .NET SDK
- Docker
-
Clone the repository:
git clone <repository-url> cd dotnet-watch-demo
-
Restore the dependencies:
dotnet restore src/DotnetWatchDemo.Api/DotnetWatchDemo.Api.csproj
-
Run the application using
dotnet watch
:cd src/DotnetWatchDemo.Api dotnet watch run
-
Alternatively, run the application using Docker:
docker-compose up --build
Once the application is running, you can access the API endpoints to perform CRUD operations on items. Use tools like Postman or curl to interact with the API.
Feel free to submit issues or pull requests for improvements or bug fixes.
This project is licensed under the MIT License.