示例#1
0
        public async Task <ActionResult> Put(string id, VueSampleModel model)
        {
            var exists = await _dbContext.VueSample.AnyAsync(f => f.Id == id);

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

            _dbContext.VueSample.Update(model);

            await _dbContext.SaveChangesAsync();

            return(Ok());
        }
示例#2
0
        public async Task Post(VueSampleModel model)
        {
            await _dbContext.AddAsync(model);

            await _dbContext.SaveChangesAsync();
        }