コード例 #1
0
        public async Task <ActionResult> Put(string id, AcronymRecord model)
        {
            var exists = await _dbContext.AcronymRecords.AnyAsync(f => f.Id == id);

            if (!exists)
            {
                return(NotFound());
            }

            _dbContext.AcronymRecords.Update(model);

            await _dbContext.SaveChangesAsync();

            return(Ok());
        }
コード例 #2
0
        public async Task Post(AcronymRecord model)
        {
            await _dbContext.AddAsync(model);

            await _dbContext.SaveChangesAsync();
        }