I have the following Interfaces defined:
public interface IStep { string Name { get; set; } } public interface IStepBuildDataSet : IStep { DataSet
You could use OfType to make it abit cleaner like this:
IStepBuildDataSet buildDataSet = Steps.OfType().Single(); IStepBuildFile buildFile = Steps.OfType().Single();
Notice, you dont need to cast the results, since OfType does that for you.