Skip to content

PetForeignKey#2

Open
deoguinho wants to merge 2 commits intomainfrom
CreatePetForeign
Open

PetForeignKey#2
deoguinho wants to merge 2 commits intomainfrom
CreatePetForeign

Conversation

@deoguinho
Copy link
Copy Markdown
Owner

No description provided.

@lucasoliveira08 lucasoliveira08 self-requested a review March 26, 2024 17:30
Comment thread DogtorAPI/Model/Pet.cs Outdated
public string Race { get; set; }
public string Color { get; set; }
public string Description { get; set; }
public Guid TutorId { get; set; }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Faltou a propriedade de navegação, por isso ele não mapeou na sua migration.

public Tutor Tutor { get; set; }

Comment thread DogtorAPI/Model/Pet.cs Outdated
Race = race;
Color = color;
Description = description;
TutorId = tutorid;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alterar para TutorID = tutorId aqui e no parâmetro da função - respeitar o padrão.


[Required]
public string Neighborhood { get; set; }
public ICollection<CreatePetRequest>? createPetRequests { get; set; }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Você não passa o CreatePetRequest aqui, um tutor é criado indiferentemente de ter um pet, certo?

public string Color { get; set; }

public string Description { get; set; }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Faltou a propriedade do tutorId - quando se cria um pet, ele não precisa obrigatoriamente ter um tutor?

Comment thread DogtorAPI/Model/Tutor.cs Outdated
public string Complement { get; set; }
public string Neighborhood { get; set; }

public ICollection<Pet> Pets { get; set; }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Faltou o "?" após ICollection<>? - pois é opcional um tutor ter um pet.

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.

2 participants