Created
January 13, 2018 04:56
-
-
Save hbulens/fa4243ce9aea95e4d98178eb47c3473d to your computer and use it in GitHub Desktop.
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 IEnumerable FindAll() | |
{ | |
using(IServiceFactory factory = new ServiceFactory(this.DirectoryPath)) | |
{ | |
ILogger logger = factory.Create(); | |
try | |
{ | |
using(IRepository repository = factory.Create(this.ConstructorImports)) | |
{ | |
List items = repository.FindAll(null).ToList(); | |
return items; | |
} | |
} catch (Exception ex) | |
{ | |
logger.LogError("Error when retrieving items.", ex); | |
return new List(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment