Пример #1
0
 public void AddPolicy(Policy policy)
 {
     using (var claimsContext = new ClaimsContext())
     {
         claimsContext.Policies.Add(policy);
         claimsContext.SaveChanges();
     }
 }
Пример #2
0
        public List <Claim> GetClaims()
        {
            using (var claimsContext = new ClaimsContext())
            {
                var claims = claimsContext.Claims;

                return(claims.ToList());
            }
        }
Пример #3
0
 public void AddClaim(Claim claim)
 {
     using (var claimsContext = new ClaimsContext())
     {
         var claims = claimsContext.Claims;
         claims.Add(claim);
         claimsContext.SaveChanges();
     }
 }
Пример #4
0
        public List <Policy> GetPolicies()
        {
            using (var claimsContext = new ClaimsContext())
            {
                var policies = claimsContext.Policies;

                return(policies.ToList());
            }
        }
        public void Setup()
        {
            _claimsContext        = new ClaimsContext();
            _claimsContextFactory = new ClaimsContextFactory();
            _claimsRepository     = new Confie.WesternGeneral.ClaimsRepository.ClaimsRepository(_claimsContextFactory);
            _updatedUser          = Guid.NewGuid().ToString("N");
            _updatedDate          = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            _minDate = DateTime.Parse(SqlDateTime.MinValue.ToString());
            _claim   = StubClaim();

            _claimsContext.Database.Delete();
        }
Пример #6
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();
            }
        }
Пример #7
0
 public Repository()
 {
     context = new ClaimsContext();
 }
 public ClaimsController(IOptions <AppSettings> ASettings, ClaimsContext ADBContext)
 {
     this.Settings = ASettings;
     DBContext     = ADBContext;
 }