예제 #1
0
        public void UpdateProject(Project modifiedProject)
        {
            var foundProject = GetProject(modifiedProject.ProjectId);

            if (foundProject == null)
            {
                _context.Projects.Add(modifiedProject);
            }
            else
            {
                foundProject.EndDate   = modifiedProject.EndDate;
                foundProject.Priority  = modifiedProject.Priority;
                foundProject.StartDate = modifiedProject.StartDate;
                foundProject.Project1  = modifiedProject.Project1;
                foundProject.Manager   = modifiedProject.Manager;
                //foundProject.Status = modifiedProject.Status;
                _context.MarkAsModified(foundProject);
            }

            _context.SaveChanges();
        }