public void Patch(Pttask task, params string[] columns)
 {
     if (columns == null || columns.Count() == 0)
     {
         return;
     }
     context.Attach(task);
     foreach (var column in columns)
     {
         context.Entry(task).Property(column).IsModified = true;
     }
 }
Пример #2
0
 public void Patch(Ptproject project, params string[] columns)
 {
     if (columns == null || columns.Count() == 0)
     {
         return;
     }
     context.Ptproject.Attach(project);
     foreach (var column in columns)
     {
         if (project.GetType().GetProperty(column).GetValue(project) != null)
         {
             context.Entry(project).Property(column).IsModified = true;
         }
     }
 }