public bool CreateLevel(AddLevel model) { var entity = new LevelTable() { XP = model.XP }; using (var ctx = new ApplicationDbContext()) { ctx.LevelTable.Add(entity); return(ctx.SaveChanges() == 1); } }
//working public IEnumerator addLevel(string name, string description, string weather, int maxScore, string json) { clearList(); Debug.Log("Adding level to user " + AccountManager.idCurrentUser + "..."); string sailsUrl = "https://immense-lake-57494.herokuapp.com/levels"; AddLevel body = new AddLevel(); body.name = name; body.json = json; body.createdAt = null; body.updatedAt = null; body.description = description; body.weather_savior = weather; body.maxScore = maxScore; body.idUser = AccountManager.idCurrentUser; string bodyJson = JsonUtility.ToJson(body); yield return(StartCoroutine(_webRequester.PostComplete(sailsUrl, bodyJson))); Debug.Log("Level Added"); UpdateList(); }
private void addimgbtn_Click(object sender, EventArgs e) { AddLevel instance = new AddLevel(); instance.ShowDialog(); }