//It has to change to use a collection of studio, rooms and schedule
        public async Task <Reservation> CreateReservation(DateTime dateOfTheReservation, Client clientReservation,
                                                          ICollection <Studio> studios,
                                                          ICollection <StudioRoom> studioRooms,
                                                          ICollection <StudioRoomSchedule> studioRoomSchedules)
        {
            Client client = await this.clientRepository.FindClientById(clientReservation.Id);

            Reservation reservation = null;

            if (client == null)
            {
                return(null);
            }

            reservation.Client = client;

            if (studios.Count == 0)
            {
                this.error.Message.Add("You must select at least one studio to make the reservation");
                return(null);
            }

            else
            {
                foreach (var studioReserved in studios)
                {
                    Studio studio = await this.studioRepository.GetStudiosById(studioReserved.Id);

                    if (studio == null)
                    {
                        this.error.Message.Add("We haven't found the studio you selected");
                        return(null);
                    }

                    //If I remember well, the entity framework will take care to generate the reservation and the Id automatically
                    ReservationStudio studioInReservation = new ReservationStudio
                    {
                        Studio = studio
                    };

                    reservation.AddStudioToReservation(studioInReservation);
                }
            }

            return(null);
        }