public ResponseItem Put(yy_Spider_News value) { var _Entity = DB.yy_Spider_News.Find(value.ID); if (_Entity != null) { _Entity.Title = value.Title; _Entity.KeyWords = value.KeyWords; _Entity.Summary = value.Summary; _Entity.CreateDate = value.CreateDate; DB.SaveChanges(); return new ResponseItem(0, ""); } return new ResponseItem(2, "不存在的蜘蛛新闻。"); }
public ResponseItem Post(yy_Spider_News value) { try { DB.yy_Spider_News.Add(value); DB.SaveChanges(); return new ResponseItem(0, "添加蜘蛛新闻成功。"); } catch (Exception ex) { return new ResponseItem(2, ex.Message); } }