Skip to content

Conversation

@RaidenPL
Copy link
Collaborator

@RaidenPL RaidenPL commented Dec 2, 2023

No description provided.

@RaidenPL RaidenPL linked an issue Dec 2, 2023 that may be closed by this pull request
{
return NotFound();
}
return Ok();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

powinno byc w srodku bloku try

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do wyjebki

public void Add(Genre entity)
{
_context.Genres.Add(entity);
_context.Add(entity);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wystarczy _context.Genres.Add(..)

{
Genre? genre = _context.Genres.Find(id) ?? throw new NotFoundException("Genre "+id+" not found in repository");
return genre;
throw new NotImplementedException();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wyjeb

{

public ICollection<int> genres_ids { get; set; }
[JsonIgnore]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Po co to ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request do kontrolera książki który do isniejącej książki dodaje gatunki

public ActionResult Put(int id, [FromBody] AssigneGenreToBookRequest request)
{
request.book_id = id;
_bookService.assigneGenre(request);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nie musisz w requescie miec pola book_id, powinno byc tak ze serwis assigneGenre przyjmuje request i samo id jako parametry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Endpoint do dodawania gatunku

3 participants