// GET: LanguageProficiencies/Create
        public IActionResult Create()
        {
            LanguageProficiencyViewModel vm;

            vm = new LanguageProficiencyViewModel(_context);
            return(View(vm));
        }
        public async Task <IActionResult> Edit(int id, LanguageProficiencyViewModel languageProficiency)
        {
            if (id != languageProficiency.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(languageProficiency.GetModel());
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LanguageProficiencyExists(languageProficiency.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            languageProficiency.loadLists(_context);
            return(View(languageProficiency));
        }
        public async Task <IActionResult> Create(LanguageProficiencyViewModel languageProficiency)
        {
            if (ModelState.IsValid)
            {
                _context.Add(languageProficiency.GetModel());
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            languageProficiency.loadLists(_context);
            return(View(languageProficiency));
        }
        // GET: LanguageProficiencies/Edit/5
        public async Task <IActionResult> Edit(int?id)
        {
            LanguageProficiencyViewModel vm;

            if (id == 0)
            {
                vm = new LanguageProficiencyViewModel(_context);
            }
            else
            {
                var languageProficiency = await _context.LanguageProficiency.FindAsync(id);

                if (languageProficiency == null)
                {
                    return(NotFound());
                }
                vm = new LanguageProficiencyViewModel(_context, languageProficiency);
            }

            return(View(vm));
        }