Beispiel #1
0
 private bool DoesGenreExist(Genre genre)
 {
     try
     {
         _genreRepository.GetGenreByName(genre.GenreName);
         return true;
     }
     catch
     {
         return false;
     }
 }
        public int CreateGenre(Genre genre)
        {
            var sql = "INSERT INTO  dbo.Genre (Name) VALUES (@genreName); SELECT CAST(SCOPE_IDENTITY() as int;";

            return _connection.ExecuteScalar<int>(sql, new { genreName = genre.GenreName});
        }