Last active
December 14, 2015 05:39
-
-
Save mookid8000/5036740 to your computer and use it in GitHub Desktop.
statically injectable aggregate root loader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ILoadAggregateRoots | |
{ | |
T Load<T>(string id) where T:Doc; | |
} | |
public static class Loader | |
{ | |
static ILoadAggregateRoots currentLoader = new ThrowMustProvideLoaderException(); | |
public static ILoadAggregateRoots Current | |
{ | |
get { return currentLoader; } | |
set { | |
if (value == null) { | |
throw new ArgumentNullException("must provide loader"); | |
} | |
currentLoader = value; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment