Here is my problem,
I fetch a json from a webservice and deserialize it into an object. Now, I want this object and its values to be accessible from anywhere in the program, how can I do that ? PS: the ultimate goal being the possibility to access the user id of this object from another class.
HttpClientService clientActeur = new HttpClientService();
ActeurJson acteurJson = new ActeurJson();
acteurJson = JsonConvert.DeserializeObject<ActeurJson>(await clientActeur.loadActeur(Login,Pass));
Here are the actorJson Class and the Actor class
public class ActeurJson
{
[JsonProperty("Acteur")]
public Acteur Acteur { get; set; }
}
public class Acteur
{
[JsonProperty("id")]
public string id { get; set; }
[JsonProperty("nom")]
public string nom { get; set; }
[JsonProperty("prenom")]
public string prenom { get; set; }
[JsonProperty("login")]
public string login { get; set; }
[JsonProperty("mdp")]
public string mdp { get; set; }
[JsonProperty("adresse")]
public string adresse { get; set; }
[JsonProperty("cp")]
public string cp { get; set; }
[JsonProperty("ville")]
public string ville { get; set; }
[JsonProperty("dateEmbauche")]
public string dateEmbauche { get; set; }
[JsonProperty("idTypeActeur")]
public string idTypeActeur { get; set; }
[JsonProperty("oldMdp")]
public string oldMdp { get; set; }
[JsonProperty("mail")]
public string mail { get; set; }
[JsonProperty("questionSecrete")]
public string questionSecrete { get; set; }
[JsonProperty("version")]
public string version { get; set; }
}
I already tried using the static keyword before the public class, it is not working