2017-01-03 1 views
0

Ici, j'utilise Asp.NetWebApi. J'ai écrit un code comme:WebApi MultipulUrl non pris en charge

public IEnumerable <Employee> GetEmployee() 
{ 
var x = pro.GetEmployees(); 
return x; 
} 
public Employee GetEmployee(int id = 0) { 
var x = pro.FindEmployee(id); 
return x; 
} 

Il y a une erreur de lancer que je passe une URL comme http://localhost:57997/api/Friends. Si je commente ce code Employee GetEmployee(int id = 0), cela fonctionne très bien.

Plusieurs actions ont été trouvées qui correspondent à la demande: GetEmployee le type Application.Api.Controllers.FriendsController GetEmployee sur le type Application.Api.Controllers.FriendsController

Répondre

0

S'il vous plaît Retirer le code

Employee GetEmployee(int id = 0) 

Et Ajouter ceci

Employee GetEmployee(int id)