Exemplo n.º 1
0
 public int Modify <TSource>(TSource model) where TSource : class
 {
     if (context.Entry(model).State == EntityState.Detached)
     {
         context.Set <TSource>().Attach(model);
         context.Entry(model).State = EntityState.Modified;
     }
     return(context.SaveChanges());
 }