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 your first object graph type (course entity)

Adding your first object graph type (course entity)

From the course: ASP.NET Core: Building a GraphQL API

Adding your first object graph type (course entity)

- [Instructor] On this part, we are going to create the first object type in our project. And for that, we are going to create the course type. So let us go to Visual Studio and see it in action. In here, I'll just go to the Solution Explorer and then I'll create a new folder. So add and then new folder. I'm going to name GraphQL because in here I'm going to put all the GraphQL related code for GraphQL. And then inside here we are going to have types, so I'll just right-click then go to new folder. I'm going to name this folder the types folder. And here we are going to add the first type and that is going to be the course type. And the reason why we are adding the course type is because in the data folder, in the models, we have the course model. And this course is just a C# class. It has some properties. The first one is of type integer, but it has the key decoration in here, which means it's going to be the primary…

Contents