I have an application that is using simple _logger.LogInformation() api with resource files (.resx).
_logger.LogInformation(LogResource.LogText);
Is it possible to rewrite this code to use the [LoggerMessageAttribute] with resource files?
As I know attribute constructors expect constant expressions, but .resx helpers are static, so this code doesn't work:
internal static partial class LoggerExtensions
{
[LoggerMessage(Level = LogLevel.Information, Message = LogResource.LogText)]
public static partial void LogText(this ILogger logger);
}