Exemplo n.º 1
0
        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());
            }
        }
Exemplo n.º 2
0
        public void TestPut(StandInfo standInfo)
        {
            var result = _standController.Put(standInfo);

            Assert.IsType <OkResult>(result);
        }