public HttpResponseMessage AddStudent([FromBody] StudentSingleModel model)
        {
#pragma warning disable IDE0059 // 从不使用分配给符号的值
            var result = _testService.AddStudent(model);
#pragma warning restore IDE0059 // 从不使用分配给符号的值

            var data = new JsonResultBuilder()
                       .SetCode(JsonResultCode.OK)
                       .SetMessage("success")
                       .SetEmptyResult().Build();


            return(new HttpResponseMessage()
            {
                StatusCode = HttpStatusCode.OK,
                Content = new StringContent(JsonConvert.SerializeObject(data))
            });
        }
Exemple #2
0
 public StandardJsonResult <StudentDto> PostStudent(StudentDto dto)
 {
     return(StandardAction(() => _testService.AddStudent(dto)));
 }