From the course: ASP.NET Core: Building a GraphQL API
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Adding relationship data
From the course: ASP.NET Core: Building a GraphQL API
Adding relationship data
- [Instructor] So far, we have worked with a single entity named course. You have learned how to query and mutate data, but real world apps you have more complex data types. You'll have to work with relational data, and that is what you're going to learn on the upcoming parts. But before you work with relational data, let us first update our existing database schema so we have a relational database. So for that, let us go to Visual Studio and see it in action. In here, if we go to the Solution Explorer, and then in here go to Data, then Models, inside the Course Class, you're going to see that we have an integer review. But a single course can have more than one review. So then I'll just comment out this line. So we are going to create a one-to-many relationship, then go to the Solution Explorer, right click on the Models then Add. We're going to add a new Class. We are going to name this class, the Review Class. Now…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.