Exemple #1
0
 public Task <bool> Add(AuthenticationContextclassReference acr)
 {
     _acrLst.Add(new AuthenticationContextclassReference
     {
         AmrLst      = acr.AmrLst,
         DisplayName = acr.DisplayName,
         IsDefault   = false,
         Name        = acr.Name,
         Type        = acr.Type
     });
     return(Task.FromResult(true));
 }
Exemple #2
0
        public async Task <bool> Update(AuthenticationContextclassReference acr)
        {
            var result = await _context.AuthenticationContextclassReferences.FirstOrDefaultAsync(a => a.Name == acr.Name).ConfigureAwait(false);

            if (result == null)
            {
                return(false);
            }

            result.AmrLst      = acr.AmrLst == null ? string.Empty : string.Join(",", acr.AmrLst);
            result.DisplayName = acr.DisplayName;
            result.Type        = (int)acr.Type;
            return(true);
        }
Exemple #3
0
        public async Task <bool> Add(AuthenticationContextclassReference acr)
        {
            _context.AuthenticationContextclassReferences.Add(new Models.AuthenticationContextclassReference
            {
                AmrLst      = acr.AmrLst == null ? string.Empty : string.Join(",", acr.AmrLst),
                DisplayName = acr.DisplayName,
                Name        = acr.Name,
                IsDefault   = acr.IsDefault,
                Type        = (int)acr.Type
            });
            await _context.SaveChangesAsync().ConfigureAwait(false);

            return(true);
        }
Exemple #4
0
        public Task <bool> Update(AuthenticationContextclassReference acr)
        {
            var rec = _acrLst.FirstOrDefault(a => a.Name == acr.Name);

            if (rec == null)
            {
                return(Task.FromResult(false));
            }

            rec.AmrLst      = acr.AmrLst;
            rec.DisplayName = acr.DisplayName;
            rec.Type        = acr.Type;
            return(Task.FromResult(true));
        }