Cleaning Up

Try to delete unimportant parameter in our Player class.

public class Player
{
    public string first_name { get; set; }
    public int id { get; set; }
    public string points_per_game { get; set; }
    public string second_name { get; set; }
    public string team_name { get; set; }  
}

Mention that our parameters' name is not well define. Example: first_name should be FirstName. How to change it without chaning our JSON files?

[JsonProperty(PropertyName = "first_name")]
public string first_name { get; set; }

// right click at underline word > Quick Actions and Refractoring

Do that for other parameters.

public class Player
{
    [JsonProperty(PropertyName = "first_name")]
    public string FirstName { get; set; }

    [JsonProperty(PropertyName = "id")]
    public int Id { get; set; }

    [JsonProperty(PropertyName = "points_per_game")]
    public Double PointsPerGame { get; set; }

    [JsonProperty(PropertyName = "second_name")]
    public string SecondName { get; set; }

    [JsonProperty(PropertyName = "team_name")]
    public string TeamName { get; set; }

}

results matching ""

    No results matching ""