예제 #1
0
 public Project PostProject([FromBody] Todoapp.Models.Project project)
 {
     project.ApplicationUser = (from u in _context.Users.Include(u => u.Projects)
                                where u.Id == User.FindFirst(ClaimTypes.NameIdentifier).Value
                                select u).ToArray()[0];
     _context.Projects.Add(project);
     _context.SaveChanges();
     return(project);
 }
예제 #2
0
 public Project PutProject(int id, [FromBody] Todoapp.Models.Project project)
 {
     _context.Entry(project).State = EntityState.Modified;
     _context.SaveChanges();
     return(project);
 }