public IActionResult Put([FromBody] StandInfo standInfo) { try { if (standInfo == null) { return(BadRequest()); } var stand = _db.StandInfos.FirstOrDefault(d => d.Name == standInfo.Name && d.Url == standInfo.Url); if (stand == null) { return(BadRequest()); } stand.DateTime = DateTime.Now; stand.Status = standInfo.Status; stand.Error = standInfo.Error; _db.SaveChanges(); return(Ok()); } catch { return(BadRequest()); } }
public void TestPut(StandInfo standInfo) { var result = _standController.Put(standInfo); Assert.IsType <OkResult>(result); }