public async Task <ActionResult <Control> > Add(Control control)
        {
            var allnewsubtype = await submissionTypeStore.GetAll();

            var             exist = allnewsubtype.Where(_ => _.Name == control.Type).ToList();
            Submission_type type  = null;

            if (exist.Count > 0)
            {
                type = exist[0];
            }
            else
            {
                type = new Submission_type(control.Type);
                submissionTypeStore.Insert(type);
                submissionTypeStore.Save();
            }

            var sub = new Submission(control.Value, type.Id);

            submissionStore.Insert(sub);
            submissionStore.Save();

            return(Ok(new Control(sub, type.Name)));
        }
        public void Test_Submission_type()
        {
            Submission_type type = new Submission_type("text");

            type.Id = 1;
            Assert.Equal(1, type.Id);
            Assert.Equal("text", type.Name);

            Submission s = new Submission("Testing TEXT", type.Id);

            s.Id   = 10;
            s.Type = type;

            Assert.Equal(10, s.Id);
            Assert.Equal("Testing TEXT", s.Fieldvalue);
            Assert.Equal(1, s.Submission_typeId);

            Assert.NotNull(s.Type);
            Assert.Equal(1, s.Type.Id);
            Assert.Equal("text", s.Type.Name);
        }