예제 #1
0
        public Project Add(Project project)
        {
            project.Department = _context.Contributors.Find(_contributorId).Department;
            project = _context.Projects.Add(project);

            _context.SaveChanges();

            return project;
        }
예제 #2
0
        public Project Update(Project project)
        {
            Project projectToUpdate = _context.Projects.Find(project.Id);

            projectToUpdate.Title = project.Title;
            projectToUpdate.Description = project.Description;

            _context.SaveChanges();

            return project;
        }