This repository contains practical assignments completed while studying Entity Framework Core, a modern ORM framework for .NET. The course focuses on core EF Core functionality including modeling, relationships, LINQ queries, and raw SQL execution.
- Created a console application using a list of
Productobjects - Populated the list with 10 entries
- Displayed products at indices 1, 5, 0, 7
- Found and displayed indexes of products by
Idat indices 1, 5 - Found and displayed indexes of products by
Nameat indices 0, 7
- Limited all string properties using Data Annotations based on their purpose
- Renamed
Idto(ClassName)Idconvention - Applied
DataType.DateforDateTimefields - Applied all changes to the database via migration
- Created an enum
StatusCodewith values:Ok,NotFound,Server - Created a new class
Errorwith properties:Message,Time,Request,Status - Added
DbSet<Error>to the database context - Configured an additional field
(ClassName)AlterIdas part of a composite key via Fluent API - Configured the
Errortype to be ignored in the database via Fluent API - Implemented exception handling that populates the
Errorcollection on invalid query (e.g., negative index) - Ensured the
Errortable is not created in the database, even though it is used in the code - Additionally, attempted to configure all of the above without using DataAnnotations, relying only on Fluent API
-
Opened the project from lesson 2
-
Implemented all entities and relationships as shown in the diagram
-
Noted use of intermediate tables
CartandKeyParamsto establish:- One-to-many relationship between User and Product
- One-to-many relationship between Keyword and Product
-
Performed migrations and updated the database
-
Seeded the database with:
- 2 users
- 3 categories
- 7 products with related keywords
-
Output results to the console:
- Displayed users with purchased products
- Displayed all keywords assigned to each product
- Displayed products within each category and their keywords
- (Optionally) Displayed keywords assigned to each category
⏱ Duration: 1h 07m 31s
⏱ Duration: 31m 59s
- Open the solution in Visual Studio or the folder in Visual Studio Code
- Restore NuGet packages if needed
- Build and run the project
- .NET SDK 6.0+
- Basic knowledge of C# and LINQ
This project is licensed under the MIT License.