jeudi 19 mars 2020

Where to place controller method, which returns a collection from one-to-many relationship, to be compliant with the api design patterns?

I am new to building .NET Core API applications and i would like to know good approach for such a problem. I have a LeagueEntity class in my application. Every LeagueEntity contains a collection of TeamEntity. I would like to create a method which returns teams for certain league. The route will be xxx/api/leagues//teams propably. I am not sure do i need to write a method in a LeaguesController or TeamsController. Where should i place it and why?

Aucun commentaire:

Enregistrer un commentaire