public story Delete(int id) { story st = context.stories.Find(id); if (st != null) { context.stories.Remove(st); context.SaveChanges(); } return(st); }
public story Update(story stchanges) { var sto = context.stories.FirstOrDefault(s => s.Id == stchanges.Id); sto.title = stchanges.title; sto.body = stchanges.body; sto.status = stchanges.status; context.SaveChanges(); return(stchanges); }
public story Add(story st) { context.stories.Add(st); context.SaveChanges(); return(st); }