Files
CannedNet/CannedNet.Admin/Services/ImageUrlService.cs
T
2026-06-17 13:39:28 -04:00

18 lines
360 B
C#

namespace CannedNet.Admin.Services;
public class ImageUrlService
{
private readonly string _baseUrl;
public ImageUrlService(string baseUrl)
{
_baseUrl = baseUrl.TrimEnd('/');
}
public string GetUrl(string? path)
{
if (string.IsNullOrEmpty(path)) return "";
return $"{_baseUrl}/{path.TrimStart('/')}";
}
}