public ActionResult AddLanguage(LanguageModel model)
        {
            if (ModelState.IsValid)
            {
                var language = new Language(model.Code, model.Name);
                Context.AddLanguage(language);

                Context.SaveChanges();
            }

            return JsonView(ModelState.IsValid, "_AddLanguage", model);
        }
        public ActionResult EditLanguage(LanguageModel model)
        {
            if (ModelState.IsValid)
            {
                Language language;
                if (!Context.Languages.TryGetById(model.Id, out language))
                    throw new InvalidOperationException(string.Format("language with id {0} was not found", model.Id));

                language.Name = model.Name;
                Context.SaveChanges();
            }

            return JsonView(ModelState.IsValid, "_EditLanguage", model);
        }
        public ActionResult EditLanguage(long id)
        {
            Language language;
            if (!Context.Languages.TryGetById(id, out language))
                throw new InvalidOperationException(string.Format("language with id {0} was not found", id));

            var model = new LanguageModel
            {
                Id = language.Id,
                Name = language.Name,
                Code = language.Code
            };

            return PartialView("_EditLanguage", model);
        }