I have two tables (Players
, Clubs
) in Database.cs using Entity Framework. I want to display data from web service into console app (client).
I would like to display all players from a certain club.
It looks should look like this.
Console app pops up and says: From which club do you want to display players?
I type in: "Los Angeles Lakers".
App should now display all the players from Los Angeles Lakers.
This is my code:
[WebMethod]
public string playerClub(string clubName)
{
using (var db = new Database())
{
string player = "";
for (int i = 0; i < db.playerList.Count; i++)
{
if (db.playerList[i].Clubs == clubName)
{
player = player + "\n" + db.playerList[i].Name + db.seznamUporabnikov[i].LastName;
}
}
return player;
}
}
It gives me an error:
Error 2 Operator '<' cannot be applied to operands of type 'int' and 'method group'
Can you please help me change this code so it will work?