I am currently learning ASP.NET core Web API with SQL Server and Entity Framework Core. This repository is a learning project that I am using to practice the basics of C# development, including CRUD operations, data modeling, and database migrations.
This repository provides a basic implementation of CRUD operations using C# and a relational database. The project structure and code samples are designed to guide you through the process of working with data, performing CRUD operations, and understanding key concepts in C# development.
To get started with this repository, follow these steps:
-
Clone the repository to your local machine using the command:
-
Open the project in your preferred development environment (such as Visual Studio, Visual Studio Code, or JetBrains Rider).
-
Set up the database:
- Ensure that you have a local or remote database server (such as SQL Server, MySQL, or PostgreSQL) available.
- Configure the database connection settings in the project's configuration files (such as
appsettings.json
) to point to your database server.
- Run the application:
- Build the project to ensure that all dependencies are resolved.
- Run the application to start the CRUD learning environment.
The project is organized as follows:
- Models: Contains the C# classes that represent the entities in the database (e.g., Student, Course, Enrollment, Instructor, Course Assignment,...).
- Data: Contains the DbContext class (e.g., SchoolContext) responsible for interacting with the database and performing CRUD operations.
- Controllers: Contains the API controllers that handle the HTTP requests and execute the corresponding CRUD operations.
- Views: Not applicable for this repository since it focuses on building API controllers.
- Migrations: Contains the database migration files generated by Entity Framework Core to create and update the database schema based on changes in the models.