Skip to content

Instantly share code, notes, and snippets.

Created January 15, 2015 09:19
Show Gist options
  • Save anonymous/cfd3b0ee1d550e6312b6 to your computer and use it in GitHub Desktop.
Save anonymous/cfd3b0ee1d550e6312b6 to your computer and use it in GitHub Desktop.
public class ReferenceValuesService{
public ReferenceValuesService(Func<Context> contextFactory){
this.contextFactory = contextFactory;
this.referenceValues = new Lazy<IEnumerable<ReferenceValue>>(() => this.contextFactory().GetReferenceValues());
}
public IEnumerable<ReferenceValue> ReferenceValues(){
return this.referenceValues.Value;
}
private readonly Lazy<IEnumerable<ReferenceValue>> referenceValues;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment