A EF Core Console Application that tracks users’ reading habits, sessions, moods, and suggestions. It’s designed to help you apply all the important concepts in Entity Framework Core practically and efficiently.
- Track multiple users, their reading sessions, and suggestions
- Log moods, notes, ratings during sessions
- Books categorized by genre and difficulty
- User’s reading performance stored in an owned type (
GenreStats) - Uses both Fluent API
- Includes manual seeding of data
Id,Name,Email,JoinDateGenreStats: FavoriteGenre, TotalPagesRead, AverageRating (Owned Type)- Navigation:
List<ReadingSession>,List<BookSuggestion>
Id,Title,Author,Genre,Pages,DifficultyLevel(Enum)- Navigation:
List<ReadingSession>
Id,UserId,BookIdStartTime,EndTime,Mood(Enum),Notes,Rating
Id,UserId,SuggestionText,SuggestedAt
-
One-to-Many:
User → ReadingSessions
User → BookSuggestions
Book → ReadingSessions -
Owned Type:
User → GenreStats
The following ERD was generated in SQL Server:
EF Core doesn't support .HasData() with owned types like GenreStats.
So the initial data is seeded manually in the Main method using:
context.Database.EnsureCreated();
context.Users.AddRange(SeedData.GetUsers());
context.SaveChanges();