DI Example
This commit is contained in:
@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DependencyExample.Core\DependencyExample.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -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