DI Example
This commit is contained in:
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace DependencyExample
|
||||
{
|
||||
public class WindowsFileManager : IFileManager
|
||||
{
|
||||
public string GetFileData(string path)
|
||||
{
|
||||
return File.ReadAllText(path);
|
||||
}
|
||||
|
||||
public void WriteFileData(string path, string data)
|
||||
{
|
||||
DependencyProvider.Logger.LogMessage($"About to write `{data}` to `{path}`");
|
||||
|
||||
File.WriteAllText(path, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user