public void AddOpenText(int code, [FromBody] OpenText_Input input) { if (Context.Active.Sessions.TryGetValue(code, out AdminInstance admin)) { ThreadPool.QueueUserWorkItem(o => admin.AddClientInput(input)); } else { //Session not found } }
/// <summary> /// Adds another option to the vote /// </summary> /// <param name="input">A Open Text input, that it takes the data from</param> public void AddOption(OpenText_Input input) { lock (QuestionLock) { MultipleChoice_Option option = new MultipleChoice_Option { Archive = new List <MultipleChoice_Input>(), Votes = new List <MultipleChoice_Input>(), Description = input.Description, UserID = input.UserID, Title = input.Title, }; Options.Add(option); } }