﻿using System.Collections.Generic;
using MovieDatabase.Core.Interfaces;
using MovieDatabase.Core.Model;

namespace MovieDatabase.Core.Services
{
    public class MovieService
    {
        private readonly IMovieRepository _movieRepository;

        public MovieService(IMovieRepository movieRepository)
        {
            _movieRepository = movieRepository;
        }

        public void AddMovie(Movie movie)
        {
            _movieRepository.Insert(movie);
        }

        public IEnumerable<Movie> GetAllMovies()
        {
            _movieRepository.Insert(new Movie {Title = "Matrix"});

            return _movieRepository.GetAll();
        }

    }
}