Esempio n. 1
0
        static void Main(string[] args)
        {
            IPersonRepository <Person> ps     = new PersonService();
            IEnumerable <Person>       people = ps.Get();

            foreach (Person person in people)
            {
                Console.WriteLine(person.Nom + " " + person.Prenom);
            }
            Console.ReadLine();
            IFilmRepository <Film> fs = new FilmService();
            Film film = fs.Get(1);

            Console.WriteLine(film.Titre);
            Console.WriteLine(film.ActeurPrincipal.Nom);
            foreach (Person person in film.Acteurs)
            {
                Console.WriteLine(person.Nom + " " + person.Prenom + " " + person.Age);
            }
            Console.ReadLine();

            ///////Mapping
            Film filmTest = new Film(0, "Die Hard", null, null);
            ///////Wrapping
            //Film filmTest = new Film();
            //filmTest.Titre = "Die Hard";
            int id = fs.Create(filmTest);

            Console.WriteLine(fs.Get(id).Titre);
            Console.ReadLine();
        }
        public ActionResult <Film> Get(string id)
        {
            var film = _filmService.Get(id);

            if (film == null)
            {
                return(NotFound());
            }

            return(film);
        }
Esempio n. 3
0
 [HttpGet("get/the/entire/database")] //Получить всю базу данных
 public ActionResult <List <FeaturedFims> > Get() =>
 _filmService.Get();