예제 #1
0
파일: Controller.cs 프로젝트: AmonHu/Armon
        public IHttpActionResult PutConfig([FromBody] ServiceConfig jObject)
        {
            if (jObject == null)
            {
                return(this.BadRequest("参数不可为空"));
            }

            string error;

            if (!jObject.IsValid(out error))
            {
                return(this.BadRequest(error));
            }
            if (jObject.Equals(Service.Config))
            {
                return(this.GetConfig());
            }
            Service.SetServiceConfig(jObject);
            return(this.GetConfig());
        }