예제 #1
0
        public void Delete(int id)
        {
            StoryTable storyTable = db.StoryTables.Find(id);

            if (storyTable == null)
            {
                return;
            }
            db.StoryTables.Remove(storyTable);
            db.SaveChanges();
        }
예제 #2
0
        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();
        }
예제 #3
0
 public void Update(StoryTable storyTable)
 {
     db.Entry(storyTable).State = EntityState.Modified;
 }