REST? DTOs
I have two entities: Book, Author
And two DTOs for both of them.
I want to receive a BookDTO in my controller action.
Do I want to have AuthorDTO in it,
like, is it normal to create another entities through a Book one?
Or do I separate it with distinct controllers: one for Books, one for Authors.
I get a Book and AuthorID (not an entire object),
or I can access Book Authors via AuthorsConroller
(books/id/authors)
What is a better way? Thank you
And two DTOs for both of them.
I want to receive a BookDTO in my controller action.
Do I want to have AuthorDTO in it,
like, is it normal to create another entities through a Book one?
Or do I separate it with distinct controllers: one for Books, one for Authors.
I get a Book and AuthorID (not an entire object),
or I can access Book Authors via AuthorsConroller
(books/id/authors)
What is a better way? Thank you