Ejemplo n.º 1
0
        private static void INITIALISER_TAG()
        {
            Guid id28        = MediaViewModel.GetAll().First(d => d.Nom == "28 jours plus tard").ID_Media;
            Guid idMassacre1 = MediaViewModel.GetAll().First(d => d.Nom == "Massacre à la tronçonneuse 1").ID_Media;
            Guid idMassacre2 = MediaViewModel.GetAll().First(d => d.Nom == "Massacre à la tronçonneuse 2").ID_Media;
            Guid idDexter1   = MediaViewModel.GetAll().First(d => d.Nom == "Dexter 1").ID_Media;
            Guid idDexter2   = MediaViewModel.GetAll().First(d => d.Nom == "Dexter 2").ID_Media;
            Guid idMylene1   = MediaViewModel.GetAll().First(d => d.Nom == "Mylene1").ID_Media;

            if (TagViewModel.GetAll().Count == 0)
            {
                TagViewModel tag = new TagViewModel();
                tag.Libelle     = "Horreur";
                tag.FK_ID_Media = id28;
                tag.save();

                tag             = new TagViewModel();
                tag.Libelle     = "Film";
                tag.FK_ID_Media = id28;
                tag.save();


                tag             = new TagViewModel();
                tag.Libelle     = "Trash";
                tag.FK_ID_Media = idMassacre1;
                tag.save();

                tag             = new TagViewModel();
                tag.Libelle     = "Film";
                tag.FK_ID_Media = idMassacre1;
                tag.save();

                tag             = new TagViewModel();
                tag.Libelle     = "Massacre";
                tag.FK_ID_Media = idMassacre1;
                tag.save();


                tag             = new TagViewModel();
                tag.Libelle     = "Trash";
                tag.FK_ID_Media = idMassacre2;
                tag.save();

                tag             = new TagViewModel();
                tag.Libelle     = "Film";
                tag.FK_ID_Media = idMassacre2;
                tag.save();

                tag             = new TagViewModel();
                tag.Libelle     = "Massacre";
                tag.FK_ID_Media = idMassacre2;
                tag.save();

                tag             = new TagViewModel();
                tag.Libelle     = "Dexter";
                tag.FK_ID_Media = idDexter1;
                tag.save();

                tag             = new TagViewModel();
                tag.Libelle     = "Dexter";
                tag.FK_ID_Media = idDexter2;
                tag.save();

                tag             = new TagViewModel();
                tag.Libelle     = "Mylene";
                tag.FK_ID_Media = idMylene1;
                tag.save();
            }
        }