private static string PlainServiceVersion(this IMMServiceInfo swashbuckleConfig) => swashbuckleConfig.ServiceVersion .Split('.') .First() .Trim('/') .ToLower() .TrimStart('v');
public static string MajorServiceVersionForUrl(this IMMServiceInfo swashbuckleConfig) => "v" + swashbuckleConfig.ServiceVersion .Split('.') .First() .Trim('/') .ToLower() .TrimStart('v');
public MMServiceBuilder(IServiceCollection services, Action <IServiceInfoBuilder> setupAction) { Services = services; _serviceSetupActions = new List <Action>(); var infoBuilder = new ServiceInfoBuilder(); setupAction(infoBuilder); ServiceInfo = infoBuilder.Build(); }
public ServiceInfoBuilder() { var assemblyName = Assembly.GetCallingAssembly().GetName(); var version = assemblyName.Version; _serviceInfo = new MMServiceInfo { ServiceName = assemblyName.Name, ServiceVersion = version is null ? "1.0" : $"{version.Major}.{version.Minor}.{version.Revision}", }; }
public static string ServiceNameForUrl(this IMMServiceInfo swashbuckleConfig) => swashbuckleConfig.ServiceName .Trim('/') .Replace(" ", "") .ToLower();
public static string FullName(this IMMServiceInfo swashbuckleConfig) => $"{swashbuckleConfig.ServiceName}, Version: {PlainServiceVersion(swashbuckleConfig)}";
public static string FullServiceVersionForUrl(this IMMServiceInfo swashbuckleConfig) => "v" + swashbuckleConfig.ServiceVersion .Trim('/') .ToLower() .TrimStart('v');