IEnumerable <LangueVM> GetAllLangues() { using (Context context = new Context()) { var donneesVM = new DonneesVM(); int userId = int.Parse(HttpContext.User.Identity.Name); var donnees = ( from personne in context.Personnes where personne.Id == userId select new DonneesVM { Langues = personne.Langues.Select(lang => new LangueVM { Id = lang.Id, Label = lang.Label, Niveau = lang.Niveau }), } ).FirstOrDefault(); return(donnees.Langues.ToList <LangueVM>()); } }
IEnumerable <FormationVM> GetAllFormations() { using (Context context = new Context()) { var donneesVM = new DonneesVM(); int userId = int.Parse(HttpContext.User.Identity.Name); var donnees = ( from personne in context.Personnes where personne.Id == userId select new DonneesVM { Formations = personne.Formations.Select(form => new FormationVM { Id = form.Id, DateDebut = form.DateDebut, DateFin = form.DateFin, Ecole = form.Ecole, Description = form.Description, Diplome = form.Diplome }), } ).FirstOrDefault(); return(donnees.Formations.ToList <FormationVM>()); } }
IEnumerable <ExperienceVM> GetAllExperiences() { using (Context context = new Context()) { var donneesVM = new DonneesVM(); int userId = int.Parse(HttpContext.User.Identity.Name); var donnees = ( from personne in context.Personnes where personne.Id == userId select new DonneesVM { Experiences = personne.Experiences.Select(form => new ExperienceVM { Id = form.Id, DateDebut = form.DatedeDebut, DateFin = form.DatedeFin, Poste = form.Poste, Entreprise = form.Entreprise, Description = form.Description }), } ).FirstOrDefault(); return(donnees.Experiences.ToList <ExperienceVM>()); } }
IEnumerable <CompetenceVM> GetAllCompetences() { using (Context context = new Context()) { var donneesVM = new DonneesVM(); int userId = int.Parse(HttpContext.User.Identity.Name); var donnees = ( from personne in context.Personnes where personne.Id == userId select new DonneesVM { Competences = personne.Competences.Select(form => new CompetenceVM { Id = form.Id, Label = form.Label, Details = form.Details }), } ).FirstOrDefault(); return(donnees.Competences.ToList <CompetenceVM>()); } }