I've implemented two services. One that pulls data from a Country API and another that pulls data from a County API.
I like to keep my controllers clean, so I'm curious if it's a good idea to combine my services together instead of keeping them apart.
I'm not exactly sure what constitutes tight coupling and when it's appropriate or not.
Should I go down this route:
public async Task<IActionResult> Get(
[FromQuery] double latitude,
[FromQuery] double longitude
{
var countryService = new CountryService();
var countryData = await countryService.Get(latitude, longitude);
var countyService = new CountyService();
var countyData = await countyService.Get(latitude, longitude);
return Ok(new Data(countryData, countyData);
}
OR
public async Task<IActionResult> Get(
[FromQuery] double latitude,
[FromQuery] double longitude
{
var combinedService = new CombinedService();
Data combinedData = await combinedService.Get(latitude, longitude);
return Ok(combinedData);
}