コード例 #1
0
        public async Task Create(T entity)
        {
            using var context = new BlogAppContext();
            await context.AddAsync(entity);

            await context.SaveChangesAsync();
        }
コード例 #2
0
        public async Task AddAsync(TEntity entity)
        {
            await _context.AddAsync(entity);

            await _context.SaveChangesAsync();
        }