vendredi 27 janvier 2017

Passing model with dependencies to rest api service

What's the "good practice" for RESTful api service when I want to pass model which has references to another model? Like:

class SomeClass
{
int Id
int Number
List<Student> Students
}

class Student
{
int Id
string Name
string Surname
SomeClass someClass
}

and while creating new student: POST .../api/students/ should I pass in student object entire SomeClass model or only class Id?

Aucun commentaire:

Enregistrer un commentaire