Esempio n. 1
0
        public static GrantPoco GetByKey(string key)
        {
            GrantPoco g = null;

            g = _grants.FirstOrDefault(c => c.Key == key);
            return(g);
        }
        public Task StoreAsync(PersistedGrant grant)
        {
            GrantPoco p = new GrantPoco
            {
                ClientId     = grant.ClientId,
                CreationTime = grant.CreationTime,
                Data         = grant.Data,
                Key          = grant.Key,
                Expiration   = grant.Expiration,
                SubjectId    = grant.SubjectId,
                Type         = grant.Type
            };

            _grantRepo.Add(p);

            return(Task.FromResult(0));
        }
        public Task <PersistedGrant> GetAsync(string key)
        {
            GrantPoco grant = _grantRepo.GetByKey(key);

            PersistedGrant result = new PersistedGrant()
            {
                ClientId     = grant.ClientId,
                CreationTime = grant.CreationTime,
                Data         = grant.Data,
                Key          = grant.Key,
                Expiration   = grant.Expiration,
                SubjectId    = grant.SubjectId,
                Type         = grant.Type
            };


            return(Task <PersistedGrant> .FromResult(result));
        }
Esempio n. 4
0
 public static void Add(GrantPoco g)
 {
     _grants.Add(g);
 }
Esempio n. 5
0
 public void Add(GrantPoco Grant)
 {
     GrantsData.Add(Grant);
 }