Skip to content

Instantly share code, notes, and snippets.

@kshyju
Created April 24, 2014 01:25
Show Gist options
  • Save kshyju/11238354 to your computer and use it in GitHub Desktop.
Save kshyju/11238354 to your computer and use it in GitHub Desktop.
generics with interface
public class KPIDataProcessor<T> : IDataProcessor<T>
{
public IEnumerable<T> Dtos { set; get; }
public void ProcessData()
{
Console.WriteLine("Processing KPI data");
}
}
public interface IDataProcessor<T>
{
IEnumerable<T> Dtos { set; get; }
void ProcessData();
}
public interface IDataLoader<T>
{
IDataProcessor<T> Processor { get; }
void CheckForFiles();
}
public class KPIDataLoader<T> : IDataLoader<T>
{
public IDataProcessor<T> Processor
{
get { return new KPIDataProcessor<string>(); }
}
public void CheckForFiles()
{
Console.WriteLine("Checking for KPI specific file and parsing to DTOS");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment