修复异步控制器返回模型配置的错误。
This commit is contained in:
parent
13cdd46180
commit
4aa3936754
|
@ -28,8 +28,8 @@ namespace Falcon.SugarApi.ApiDefinistions
|
|||
}
|
||||
var art = action.ActionMethod.ReturnType;
|
||||
Type returnType =
|
||||
art.IsGenericType && art.IsAssignableFrom(typeof(Task<>)) ? art.GenericTypeArguments[0].GetGenericArguments()[0] :
|
||||
art;
|
||||
art.IsGenericType && art.GetGenericTypeDefinition() == typeof(Task<>) ?
|
||||
art.GenericTypeArguments[0] : art;
|
||||
action.Filters.Add(new ProducesResponseTypeAttribute(returnType, StatusCodes.Status200OK));
|
||||
action.Filters.Add(new ProducesResponseTypeAttribute(typeof(ExceptionModel), StatusCodes.Status400BadRequest));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user