예제 #1
0
 public void Edit(ProjectManagerDbContext db)
 {
     var project = Mapper.Map<ProjectViewModel, Project>(this);
     db.Entry(project).State = EntityState.Modified;
     db.SaveChanges();
 }
예제 #2
0
 public void Create(ProjectManagerDbContext db)
 {
     var project = Mapper.Map<ProjectViewModel, Project>(this);
     db.Projects.Add(project);
     db.SaveChanges();
 }