public void InsertOrUpdateGraph(News newsGraph)
 {
     if (newsGraph.State == State.Added)
     {
         // New Entity
         _context.News.Add(newsGraph);
     }
     else
     {
         // Existing User
         _context.News.Add(newsGraph);
         _context.ApplyStateChanges();
     }
 }
 public void InsertOrUpdateGraph(SiteSetting siteSettingGraph)
 {
     if (siteSettingGraph.State == State.Added)
     {
         // New Entity
         _context.SiteSettings.Add(siteSettingGraph);
     }
     else
     {
         // Existing User
         _context.SiteSettings.Add(siteSettingGraph);
         _context.ApplyStateChanges();
     }
 }
示例#3
0
 public void InsertOrUpdateGraph(Module moduleGraph)
 {
     if (moduleGraph.State == State.Added)
     {
         // New Entity
         _context.Modules.Add(moduleGraph);
     }
     else
     {
         // Existing User
         _context.Modules.Add(moduleGraph);
         _context.ApplyStateChanges();
     }
 }
 public void InsertOrUpdateGraph(WebsiteFile websiteFileGraph)
 {
     if (websiteFileGraph.Id == default(Guid))
     {
         // New Entity
         _context.WebsiteFiles.Add(websiteFileGraph);
     }
     else
     {
         // Existing File
         websiteFileGraph.State = State.Modified;
         _context.WebsiteFiles.Add(websiteFileGraph);
         _context.ApplyStateChanges();
     }
 }
示例#5
0
 public void InsertOrUpdateGraph(ModuleContent moduleContentGraph)
 {
     if (moduleContentGraph.Id == default(int))
     {
         // New Entity
         _context.ModuleContents.Add(moduleContentGraph);
     }
     else
     {
         // Existing User
         moduleContentGraph.State = State.Modified;
         _context.ModuleContents.Add(moduleContentGraph);
         _context.ApplyStateChanges();
     }
 }