Here I have a simple scenario with two methods where I get an ambiguous invocation from one another:
This is a my code:
public IEnumerable<JobsViewModel> GetJobsViewModels(Guid vesselId, int status, Func<JobsNoSubsYpdcResult, bool> predicate = null)
=> predicate == null
? Mapper.Map<IEnumerable<JobsViewModel>>(_procedureService.Tech_GetJobsNoSubsYPDC(vesselId, status))
: Mapper.Map<IEnumerable<JobsViewModel>>(_procedureService.Tech_GetJobsNoSubsYPDC(vesselId, status).Where(predicate));
public IEnumerable<JobsViewModel> GetJobsViewModels(Guid vesselId, int status, Func<JobsViewModel, bool> predicate = null)
=> predicate == null
? GetJobsViewModels(vesselId, status)
: GetJobsViewModels(vesselId, status).Where(predicate);
I dont like changing the names of methods but from the second one I get the error message:
Ambiguous Invocation
I would like to call first one from second one like I am trying to do, does anybody know how can I do this without changing the method names otherwise I am supposed to change them ?