Skip to content

Instantly share code, notes, and snippets.

@mgjam
Created November 20, 2019 18:39
Show Gist options
  • Save mgjam/e815a07cad5ee795ae47548d4ebb19e5 to your computer and use it in GitHub Desktop.
Save mgjam/e815a07cad5ee795ae47548d4ebb19e5 to your computer and use it in GitHub Desktop.
interface IService
{
string GetData();
}
interface IHttpService : IService {}
class HttpService : IHttpService
{
public string GetData() => "Data obtained via HTTP";
}
class LoggingService : IService
{
private readonly IHttpService service;
public LoggingService(IHttpService service)
{
this.service = service;
}
public string GetData()
{
// Logging done
return service.GetData();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment