public void Delete(int id) { StoryTable storyTable = db.StoryTables.Find(id); if (storyTable == null) { return; } db.StoryTables.Remove(storyTable); db.SaveChanges(); }
public void Create(StoryTable storyTable) { DateTime tm = DateTime.Now; string statusDefault = "Открыта"; StoryTable tb1 = new StoryTable(); tb1.Status = statusDefault; tb1.Story = storyTable.Story; tb1.Time_enter = tm; db.StoryTables.Add(tb1); db.SaveChanges(); }
public void Update(StoryTable storyTable) { db.Entry(storyTable).State = EntityState.Modified; }