Skip to content

Commit 8cab5e1

Browse files
committed
chore: Simplified GetServiceName method
1 parent 0852ab9 commit 8cab5e1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ protected virtual string GetBaseUri(ServiceRouteOptions globalOptions, Pluraliza
102102

103103
private string GetServiceName(PluralizationService? pluralizationService)
104104
{
105-
var typeName = GetType().Name;
106-
var index = typeName.LastIndexOf("Service", StringComparison.OrdinalIgnoreCase);
107-
var serviceName = typeName.Remove(index);
105+
var serviceName = GetType().Name.TrimEnd("Service", StringComparison.OrdinalIgnoreCase);
108106
if (pluralizationService == null)
109107
return serviceName;
110108

0 commit comments

Comments
 (0)