Hi, this description may weired! but as a POC I want to do something like ..
I have an Employee controller .this controller is concidered as main controller and having a methode which fetch all the employee details based on their grade.Now i have to create 2 microservices for my project.Age and Gender is the 2 seperate MS.I want to know the correct way of creating/implimenting these microservices.
In Employee controller
- [HttpPost("api/Employee/GetallEmployee")]
- public async Task GetallEmployee(input)
- {
-
-
-
-
- mergedresult= result1+result2
- }
But in this i have some microservices like Age and Gender means for creating microservices in to my solution i have created seperate 2 controller like AgeController and GenderController
But the challenge i am facing is i have to call the main api only api/Employee/GetallEmployee
by using this i have to call both below controller and in main methode i shud combain the 2 joson results.Anyone please help me
AgeController
- [HttpPost("api/Age/Ageofall")]
- public async Task Ageofall(input)
- {
- var result1 = await _getemployee.getalldetails(input);
- return new JsonResult(result1);
- }
- GenderController
- [HttpPost("api/Gender/Genderofall")]
- public async Task Genderofall(input)
- {
- var result2 = await _getemployee.getalldetails(input);
- return new JsonResult(result2);
- }
Please suggest the best practice to create microservices if i am doing wrong here..Thanks