Esempio n. 1
0
 public static void InsertOnSubmit(this DbSet<Forum> source, Forum forum)
 {
     if (forum.ForumID == default(int))
     {
         // New entity
         source.Add(forum);
     }
     else
     {
         // Existing entity
         source.Attach(forum);
     }
 }
Esempio n. 2
0
 public static void DeleteOnSubmit(this DbSet<Forum> source, Forum forum)
 {
     source.Remove(forum);
 }