public static ILookupValuesRepository GetRepository(RepositorySize size = RepositorySize.Medium, string repositoryKey = "common") { var sessionKey = "Repository_" + repositoryKey + "_" + size; if (HttpContext.Current.Session[sessionKey] == null) { HttpContext.Current.Session[sessionKey] = CreateRepository(size); } return(HttpContext.Current.Session[sessionKey] as ILookupValuesRepository); }
public static ILookupValuesRepository GetRepository(RepositorySize size = RepositorySize.Medium, string repositoryKey = "common") { var sessionKey = "Repository_" + repositoryKey + "_" + size; if (HttpContext.Current.Session[sessionKey] == null) { HttpContext.Current.Session[sessionKey] = CreateRepository(size); } return HttpContext.Current.Session[sessionKey] as ILookupValuesRepository; }
public static IRepositoryContainer GetRepository(RepositorySize size = RepositorySize.Medium, string repositoryKey = "common") { var appKey = "Repository_" + repositoryKey + "_" + size; if (HttpContext.Current.Application[appKey] == null) { HttpContext.Current.Application[appKey] = CreateRepository(size); } return(HttpContext.Current.Application[appKey] as IRepositoryContainer); }
private static IRepositoryContainer CreateRepository(RepositorySize size) { var studentCount = 8; //Default: Small switch (size) { case RepositorySize.Medium: studentCount = 128; break; case RepositorySize.Large: studentCount = 1024; break; } return new MemoryRepositoryContainer(new MemoryDataGenerator().Generate(studentCount)); }
private static IRepositoryContainer CreateRepository(RepositorySize size) { var studentCount = 8; //Default: Small switch (size) { case RepositorySize.Medium: studentCount = 128; break; case RepositorySize.Large: studentCount = 1024; break; } return(new MemoryRepositoryContainer(new MemoryDataGenerator().Generate(studentCount))); }
protected RepositoryBasedController(RepositorySize size = RepositorySize.Medium, string repositoryKey = "common") { _repository = RepositorySesssion.GetRepository(size, repositoryKey); }
private static ILookupValuesRepository CreateRepository(RepositorySize size) { return(new MemoryRepositoryContainer(new MemoryLookupValues())); }
private static ILookupValuesRepository CreateRepository(RepositorySize size) { return new MemoryRepositoryContainer(new MemoryLookupValues()); }
protected RepositoryBasedController(RepositorySize size = RepositorySize.Medium, string repositoryKey = "common") { _repository = RepositorySesssion.GetRepository(size, repositoryKey); }
public static IRepository <T> GetRepository <T>(RepositorySize size = RepositorySize.Medium, string repositoryKey = "common") { var sessionKey = "Repository_" + repositoryKey + "_" + size; return(HttpContext.Current.Session[sessionKey] as IRepository <T>); }