private static void GenerateLogServiceFile(string basePath, Type type, Type nullableAttributeType) { string loggedServiceName = GetLogServiceName(type.Name); var fileName = Path.Combine(basePath, loggedServiceName + ".cs"); var generator = new LoggedServiceCodeGenerator(nullableAttributeType); var fileContent = generator.Generate(type); File.WriteAllText(fileName, fileContent); }
private static IEnumerable <string> GenerateLogServiceFile(string basePath, Type type, Type nullableAttributeType) { string loggedServiceName = GetLogServiceName(type.Name); var isIService = type.Name == "IService"; var baseClassName = GetBaseClassName(type.Name); string parentLoggedServiceName = isIService ? "ILoggedService" : GetLogServiceName(type.BaseType?.Name ?? "IService"); var fileName = Path.Combine(basePath, loggedServiceName + ".cs"); var generator = new LoggedServiceCodeGenerator(nullableAttributeType); var fileContent = generator.Generate(type); File.WriteAllText(fileName, fileContent); var list = new List <string> { $"$(MSBuildThisFileDirectory){Path.GetFileName(fileName)}" }; return(list); }