using ExtensiblePortfolioSite.SDK.Git;

using System;

namespace ExtensiblePortfolioSite.SDK.Caching
{
    internal sealed class CacheUser : GitCacheItemBase<IUser>
    {
        private readonly Uri User;

        internal CacheUser(GitServiceCache Parent, Uri User) : base(Parent) => this.User = User;

        protected override TimeSpan Lifetime => Cache.GitRepositoryLifetime;
        protected override IUser RetriveValue() => this.Parent.ServiceProvider.GetUser(this.User);
    }
}
