using ExtensiblePortfolioSite.SDK.Git;

using System;

namespace ExtensiblePortfolioSite.SDK.Caching
{
    internal sealed class CacheRepo : GitCacheItemBase<IRepository>
    {
        private readonly Uri Repository;

        internal CacheRepo(GitServiceCache Parent, Uri Repository) : base(Parent) => this.Repository = Repository;

        protected override TimeSpan Lifetime => Cache.GitRepositoryLifetime;
        protected override IRepository RetriveValue() => this.Parent.ServiceProvider.GetRepository(this.Repository);
    }
}
