AgilityContentRepository Use in Console Applications / WebJob
Hey Agility <gang signs>
Is it possible to use the AgilityContentRepository object in a console application or a WebJob.
I'm currently trying to do so and I'm running into an issue where when I attempt to request data via from a repo thats been created and instantiated, but I'm consistently getting a null reference. Unfortunately I'm uncertain if a connection is being created, and the object that I'm creating is just running off the default values.
for example I've the following:
public static Awesome GetAwesome()
Awesome item = default(Awesome);
var repo = CreateRepository<Awesome>("Awesome", "en-ca");
if (repo != null)
item = repo.Item(string.Empty);
private static IAgilityContentRepository<TRepository> CreateRepository<TRepository>(
string languageCode) where TRepository : AgilityContentItem
IAgilityContentRepository<TRepository> repository = default(IAgilityContentRepository<TRepository>);
repository = new AgilityContentRepository<TRepository>(referenceName, languageCode);
repository = default(IAgilityContentRepository<TRepository>);
if I try and use the GetAwesome() function it throws an exception on item.repo.Item(string.Empty) and I'm unsure as to why. Using this in and mvc application there are no issues. When I use this in my console application if I've never used this method, or I've deleted my temp files this works, but never again after that.