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

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

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

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

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