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); }
public SimpleGenre CreateGenre(CreateGenreRequest request) { var genre = GenresRepository.CreateGenre(request.Name); return(Mapper.Map <SimpleGenre>(genre)); }