Developer 02 353088a6b2 feat: Integration von SimplifiedResponse und seiner Erweiterung abgeschlossen
- Methode ähnlich zu Angular's Subscribe für verbesserte asynchrone Verarbeitung implementiert.
- Modelle erstellt und Methoden für den GetSystemDetails-Endpunkt hinzugefügt.
2024-07-29 17:41:43 +02:00

34 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WindreamHub.Legacy.Client.Routes
{
public static class RouteExtensions
{
public static string GetRouteName(this object service)
{
// Get the full class name including namespace
string fullClassName = service.GetType().FullName;
// Extract the class name part by getting the substring after the last dot (.)
string className = fullClassName.Substring(fullClassName.LastIndexOf('.') + 1);
// Remove the "RouteService" part and return the remainder
string suffix = "RouteService";
if (className.EndsWith(suffix))
{
// Remove the "RouteService" part
string prefix = className.Substring(0, className.Length - suffix.Length);
return prefix;
}
else
{
throw new ArgumentException("Class name does not follow the expected format.");
}
}
}
}