private Genre GetGenre(Genre g)
        {
            var genre = _entities.Genres.Where(o => o.Code == g.Code).FirstOrDefault();

            if (genre == null)
            {
                genre = new Genre {
                    Name = g.Name, Code = g.Code, Rated = 0
                };
                _entities.AddToGenres(genre);
                _entities.SaveChanges();
            }
            return(genre);
        }