public async Task Create(ViewTest vm)
        {
            foreach (Question question in vm.Questions)
            {
                await _repoQ.CreateQuestion(question);
            }
            var current = new Test();
            var result  = vm.DiffUpdateProperties(current);
            await _repo.CreateTest(result);

            await _repo.SaveChangesAsync();
        }
        public async Task <IActionResult> Edit(string id, ViewTest vm)
        {
            var test = _repo.GetTest(id);

            if (test == null)
            {
                var error = new { StatusText = "There is no item with this id" };
                return(BadRequest(error));
            }
            var result = vm.DiffUpdateProperties(test);

            _repo.UpdateTest(result);
            await _repo.SaveChangesAsync();

            return(Ok());
        }