DI Example

This commit is contained in:
Luke Malpass
2018-06-13 07:29:08 +01:00
parent 9178d853d6
commit c97c685af9
13 changed files with 219 additions and 0 deletions

View File

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,23 @@
using System;
namespace DependencyExample
{
public static class DependencyProvider
{
// This would be from the DI service
public static IFileManager FileManager { get; set; }
public static ILogger Logger { get; set; }
}
public interface IFileManager
{
void WriteFileData(string path, string data);
string GetFileData(string path);
}
public interface ILogger
{
void LogMessage(string message);
}
}