Example #1
0
        public async Task <bool> AddAsync(Genre genre)
        {
            try
            {
                await _context.AddAsync(genre);

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

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

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

                await _context.SaveChangesAsync();
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }