Ejemplo n.º 1
0
        public IEnumerable <FormateurFormation> SearchFormateurFormations([FromQuery] string searchTerm)
        {
            if (!String.IsNullOrEmpty(searchTerm))
            {
                var formateurFormations = _formationService.GetFormations()
                                          .Where(i => i.Titre.Contains(searchTerm))
                                          .Select(formation => new FormateurFormation
                {
                    FormationId = formation.Id,
                    Formation   = formation
                }).ToList();

                return(formateurFormations);
            }
            else
            {
                return(new List <FormateurFormation>());
            }
        }