I have situation where I have to make a call to "api/Department/departmentId" from the Client(asp.net webforms) . I have 1->many relationship between Department and Emplyoee Table.In webApi , I have to make call to both the below methods with the same departmentId as input. I know this is not possible with single route. So , I request sometime to give me an idea , how to achieve this. My dbContext contains both the entites.
public List<Employee> GetEmployeesByDepartmentId(string departmentId)
{
return dbSet.Where(p => p.DepartmentDepartmentId == departmentId).Select(p => p).ToList();
}
public string GetDepartmentNameByDepartmentId(string departmentId)
{
return dbSet.Select(p => p.Department.DepartmentName).ToString(); ;
}