public async Task <ActionResult> DeleteConfirmed(int id)
        {
            ReferencedLink referencedlink = await db.GetByIdAsync(id);

            db.Remove(referencedlink);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        // GET: /BackOffice/ReferencedLink/Create
        public ActionResult Create()
        {
            var link = new ReferencedLink();

            link.Translations.Add(new ReferencedLinkTranslation
            {
                LanguageCode = LanguageDefinitions.DefaultLanguage
            });

            return(View(link));
        }
        public async Task <ActionResult> Create(ReferencedLink referencedlink)
        {
            if (ModelState.IsValid)
            {
                db.Add(referencedlink);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(referencedlink));
        }
        // GET: /BackOffice/ReferencedLink/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReferencedLink referencedlink = await db.GetByIdAsync(id);

            if (referencedlink == null)
            {
                return(HttpNotFound());
            }
            return(View(referencedlink));
        }
        public async Task <ActionResult> Edit(ReferencedLink referencedlink)
        {
            if (ModelState.IsValid)
            {
                db.Update(referencedlink);

                foreach (var t in referencedlink.Translations)
                {
                    db.UpdateTranslation(t);
                }

                await db.SaveChangesAsync();

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