Example #1
0
 public void AddPolicy(Policy policy)
 {
     using (var claimsContext = new ClaimsContext())
     {
         claimsContext.Policies.Add(policy);
         claimsContext.SaveChanges();
     }
 }
Example #2
0
 public void AddClaim(Claim claim)
 {
     using (var claimsContext = new ClaimsContext())
     {
         var claims = claimsContext.Claims;
         claims.Add(claim);
         claimsContext.SaveChanges();
     }
 }
Example #3
0
        public ClaimsController(ClaimsContext context, ILogger <ClaimsController> logger)
        {
            _context = context;
            _logger  = logger;

            if (_context.ClaimItems.Count() == 0)
            {
                // Create a new ClaimItem if collection is empty,
                // which means you can't delete all ClaimItems.
                _context.ClaimItems.Add(createTestClaimData());
                _context.SaveChanges();
            }
        }