Add interface shown in video
This commit is contained in:
parent
1962ab2ead
commit
9f59ca3e45
4 changed files with 11 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
public class BadLogger
|
||||
public class BadLogger : IBadLogger
|
||||
{
|
||||
public void Log(string message, LogType logType, LogTarget target, Exception? ex)
|
||||
{
|
||||
|
|
4
Facade/IBadLogger.cs
Normal file
4
Facade/IBadLogger.cs
Normal file
|
@ -0,0 +1,4 @@
|
|||
public interface IBadLogger
|
||||
{
|
||||
void Log(string message, LogType logType, LogTarget target, Exception? ex);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
public class Logger : ILogger
|
||||
{
|
||||
private readonly BadLogger _logger;
|
||||
private readonly IBadLogger _logger;
|
||||
public Logger()
|
||||
{
|
||||
_logger = new BadLogger();
|
||||
|
|
|
@ -11,4 +11,8 @@ I came up with the following 5 Design Patterns:
|
|||
2. [Decorator Pattern](Decorator)
|
||||
3. [Observer Pattern](Observer)
|
||||
4. [Singleton Pattern](Singleton)
|
||||
5. [Facade Pattern](Facade)
|
||||
5. [Facade Pattern](Facade)
|
||||
|
||||
To run them just `cd` into each folder and run `dotnet run`.
|
||||
|
||||
Note: You will need the .Net Core SDK installed to run these.
|
Loading…
Reference in a new issue