Beispiel #1
0
        public async Task <bool> AddAsync(Author author)
        {
            try
            {
                await _context.AddAsync(author);

                await _context.SaveChangesAsync();
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }
Beispiel #2
0
        public async Task <bool> AddAsync(Genre genre)
        {
            try
            {
                await _context.AddAsync(genre);

                await _context.SaveChangesAsync();
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }
Beispiel #3
0
        public async Task <bool> AddAsync(Category category)
        {
            try
            {
                await _context.AddAsync(category);

                await _context.SaveChangesAsync();
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }
Beispiel #4
0
        public async Task <bool> AddAsync(Publisher pub)
        {
            try
            {
                await _context.AddAsync(pub);

                await _context.SaveChangesAsync();
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }
Beispiel #5
0
        public async Task <bool> AddAsync(Book book)
        {
            try
            {
                await _context.AddAsync(book);

                await _context.SaveChangesAsync();
            }
            catch (Exception e)

            {
                return(false);
            }
            return(true);
        }