Skip to content

Commit ee9de52

Browse files
authored
Merge pull request #1 from BlazorExpress/features/method-return-type-name-support
Update project version and enhance return type handling
2 parents c58dbe0 + 0e712d1 commit ee9de52

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

BlazorExpress.Bulma.Docx/BlazorExpress.Bulma.Docx.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<PropertyGroup>
44
<PackageId>BlazorExpress.Bulma.Docx</PackageId>
5-
<Version>0.2.0</Version>
6-
<PackageVersion>0.2.0</PackageVersion>
5+
<Version>0.2.1</Version>
6+
<PackageVersion>0.2.1</PackageVersion>
77
<PackageIconUrl>logo.png</PackageIconUrl>
88
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
99
<PackageProjectUrl>https://github.com/BlazorExpress/BlazorExpress.Bulma.Docx</PackageProjectUrl>
@@ -35,7 +35,7 @@
3535
</ItemGroup>
3636

3737
<ItemGroup>
38-
<PackageReference Include="BlazorExpress.Bulma" Version="0.1.0" />
38+
<PackageReference Include="BlazorExpress.Bulma" Version="0.1.1" />
3939
</ItemGroup>
4040

4141
<ItemGroup>

BlazorExpress.Bulma.Docx/Components/DocxTable/DocxMethodRow.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public partial class DocxMethodRow<TItem> : ComponentBase
66

77
private string Description => MethodInfo.GetMethodDescription();
88

9-
public string ReturnType => MethodInfo.GetMethodReturnType();
9+
public string ReturnType => MethodInfo.GetMethodReturnTypeName() ?? MethodInfo.GetMethodReturnType();
1010

1111
public string MethodNameWithParameters => $"{MethodInfo.Name}({MethodParameters})";
1212

BlazorExpress.Bulma.Docx/Extensions/MethodInfoExtensions.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,15 @@ public static string GetMethodParameters(this MethodInfo methodInfo)
5050
/// <returns>string</returns>
5151
public static string GetMethodReturnType(this MethodInfo methodInfo)
5252
=> methodInfo.ReturnType.GetCSharpTypeName();
53+
54+
/// <summary>
55+
/// Get method return type name.
56+
/// </summary>
57+
/// <param name="methodInfo"></param>
58+
/// <returns>string</returns>
59+
public static string GetMethodReturnTypeName(this MethodInfo methodInfo)
60+
{
61+
var parameterTypeNameAttribute = methodInfo.GetCustomAttributes(typeof(MethodReturnTypeNameAttribute), false).FirstOrDefault() as MethodReturnTypeNameAttribute;
62+
return parameterTypeNameAttribute?.TypeName ?? null!;
63+
}
5364
}

0 commit comments

Comments
 (0)