-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
We have our own custom set of log events that we keep track of in a database. The severity is stored with a custom LogLevel enum:
public enum LogLevel
{
Trace = 0,
Debug = 1,
Information = 2,
Warning = 3,
Error = 4,
Critical = 5,
None = 6
}
For the DAL class, we have a method that has this format:
public async Task<IEnumerable<LogMessage>> GetLogsForObject(string objectType, long objectId, LogLevel minLogLevel = LogLevel.Information)
It generates the following interface:
public partial interface ILogMessageRepository
{
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<TSWCloud.Domain.Logging.LogMessage>> GetLogsForObject(string objectType, long objectId, TSWCloud.Domain.Logging.LogLevel minLogLevel = 2);
}
When compiling, this gives the error:
A value of type 'int' cannot be used as a default parameter because there is no standard conversions to type LogLevel
Instead, it should generate the following interface:
public interface ILogMessageRepository
{
Task<IEnumerable<LogMessage>> GetLogsForObject(string objectType, long objectId,
LogLevel minLogLevel = LogLevel.Information);
}
Metadata
Metadata
Assignees
Labels
No labels