public void AddPolicy(Policy policy) { using (var claimsContext = new ClaimsContext()) { claimsContext.Policies.Add(policy); claimsContext.SaveChanges(); } }
public void AddClaim(Claim claim) { using (var claimsContext = new ClaimsContext()) { var claims = claimsContext.Claims; claims.Add(claim); claimsContext.SaveChanges(); } }
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(); } }