public static Dojodachi Get(HttpContext _) { string session = _.Session.GetString("dachi"); if (session is null) { dojo = new Dojodachi(); _.Session.SetString("dachi", JsonConvert.SerializeObject(dojo)); } else { dojo = JsonConvert.DeserializeObject <Dojodachi>(session); } return(dojo); }
public static Dojodachi Get(HttpContext context) { string dd = context.Session.GetString("dachi"); if (dd is null) { Dojodachi dojo = new Dojodachi(); context.Session.SetString("dachi", JsonConvert.SerializeObject(dojo)); return(dojo); } else { Dojodachi dojo = JsonConvert.DeserializeObject <Dojodachi>(dd); return(dojo); } }
public static Dojodachi NewDojodachi() { dojo = new Dojodachi(); return(dojo); }
public static void Save(HttpContext _, Dojodachi dojo) { _.Session.SetString("dachi", JsonConvert.SerializeObject(dojo)); }