示例#1
0
        public Genre CreateGenre(Genre genre)
        {
            var genres = genresRepository.ContainsGenre(genre);

            if (genres == null || !genres.Any())
            {
                genre.Id     = Guid.NewGuid();
                genre.Active = true;
                genresRepository.CreateGenre(genre);
                return(genre);
            }
            return(null);
        }
示例#2
0
        public SimpleGenre CreateGenre(CreateGenreRequest request)
        {
            var genre = GenresRepository.CreateGenre(request.Name);

            return(Mapper.Map <SimpleGenre>(genre));
        }