У меня есть контроллер webapi, как показано ниже:
[ResponseType(typeof(SampleDto))]
public IHttpActionResult GetSample(string name, string guid)
и запрос принимает имя и идентификатор в виде строки запроса, например: http://www.example.com/api/Controller1/GetSample?name=james&guid=
гайд пустой.
Когда я выдаю запрос, возникает ошибка:
WARN 2018-09-29 07:04:21,361 [18 ] nHandling.AbpApiExceptionFilterAttribute - Method arguments are not valid! See ValidationErrors for details.
Abp.Runtime.Validation.AbpValidationException: Method arguments are not valid! See ValidationErrors for details.
WARN 2018-09-29 07:04:21,361 [18 ] nHandling.AbpApiExceptionFilterAttribute - There are 2 validation errors:
WARN 2018-09-29 07:04:21,361 [18 ] nHandling.AbpApiExceptionFilterAttribute - A value is required but was not present in the request. (guid.String)
WARN 2018-09-29 07:04:21,361 [18 ] nHandling.AbpApiExceptionFilterAttribute - A value is required but was not present in the request. (guid.String)
Где я могу изменить правило проверки?
public IHttpActionResult GetSample(string name, string guid = string.Empty)
, чтобы сделать его необязательным - person vivek nuna   schedule 29.09.2018http://www.example.com/api/Controller1/GetSample?name=james
без&guid=
- person aaron   schedule 29.09.2018