diff --git a/Falcon.SugarApi/ApiDefinistions/ApiResponseTypeModelProvider.cs b/Falcon.SugarApi/ApiDefinistions/ApiResponseTypeModelProvider.cs index 917cf0e..fdb8346 100644 --- a/Falcon.SugarApi/ApiDefinistions/ApiResponseTypeModelProvider.cs +++ b/Falcon.SugarApi/ApiDefinistions/ApiResponseTypeModelProvider.cs @@ -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)); }