Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.