public ClassificationEditViewModel(
            Classification c,
            string languageCode = LanguageDefinitions.DefaultLanguage,
            IEnumerable<string> availableLanguages = null)
        {
            availableLanguages = availableLanguages ?? new List<string>();

            Id = c.Id;
        }
        public async Task<ActionResult> Create(ClassificationTranslation classification)
        {
            if (DoesClassificationExist(classification))
            {
                ModelState.AddModelError("Value", ClassificationStrings.ValError_AlreadyExists);
            }


            if (ModelState.IsValid)
            {
                var c = new Classification();

                c.Translations.Add(classification);

                db.Add(c);
                await db.SaveChangesAsync();

                return RedirectToAction("Index");
            }

            return View(classification);
        }
        public async Task<ActionResult> AuxAdd(ClassificationTranslation t)
        {
            var cl = db.Entities
                .FirstOrDefault(c => c.Translations.Any(ct =>
                    ct.LanguageCode == t.LanguageCode &&
                    ct.Value == t.Value &&
                    ct.ClassificationId != t.ClassificationId)
                );

            if (cl == null)
            {
                cl = new Classification();
                cl.Translations.Add(t);

                db.Add(cl);
                await db.SaveChangesAsync();
            }

            return Json((await db.Entities
                .OrderBy(ct => ct.Id)
                .ToListAsync())
                .Select(ct => new TranslatedViewModel<Classification, ClassificationTranslation>(ct))
                .Select(ct => new
                {
                    value = ct.Entity.Id.ToString(),
                    text = ct.Translation.Value,
                    selected = ct.Entity.Id == cl.Id
                })
                .ToList());
        }
        public async Task<ActionResult> Edit(Classification classification)
        {
            for (var i = 0; i < classification.Translations.Count; i++)
            {
                var pt = classification.Translations[i];
                if (DoesClassificationExist(pt))
                {
                    ModelState.AddModelError("Translations[" + i + "].Value",
                        ClassificationStrings.ValError_AlreadyExists);
                }
            }

            if (ModelState.IsValid)
            {
                foreach (var t in classification.Translations)
                {
                    db.UpdateTranslation(t);
                }

                await db.SaveChangesAsync();

                return RedirectToAction("Index");
            }
            return View(classification);
        }