Beispiel #1
0
        public async Task <int> CreateAsync(ArtistDTO artist)
        {
            var entity = new Artist
            {
                Name = artist.Name
            };

            _context.Artists.Add(entity);

            return(await _context.SaveChangesAsync());
        }
Beispiel #2
0
        public async Task <int> CreateAsync(AlbumDTO album)
        {
            var entity = new Album
            {
                Title    = album.Title,
                ArtistId = album.ArtistId,
                Year     = album.Year,
                Cover    = album.Cover
            };

            _context.Albums.Add(entity);

            return(await _context.SaveChangesAsync());
        }