public async Task <ActionResult <Project> > DeleteProject(int id)
        {
            var project = await _context.Projects.FindAsync(id);

            if (project == null)
            {
                return(NotFound());
            }

            _context.Projects.Remove(project);
            await _context.SaveChangesAsync();

            return(project);
        }
示例#2
0
 public async Task Commit()
 {
     await _context.SaveChangesAsync();
 }