예제 #1
0
        public async Task <bool> AddAsync(PostEntity entity)
        {
            await _dbContext.Posts.AddAsync(entity);

            try
            {
                await _dbContext.SaveChangesAsync();

                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
예제 #2
0
        public async Task <bool> AddAsync(BookmarkEntity entity)
        {
            await _dbContext.Bookmarks.AddAsync(entity);

            try
            {
                await _dbContext.SaveChangesAsync();

                return(true);
            }
            catch (Exception e)
            {
                _logger.LogError("Has Exception", e);
                return(false);
            }
        }