Beispiel #1
0
 public GetAccountProvidersQueryHandlerTestsFixture()
 {
     Query = new GetAccountProvidersQuery(1);
     Db    = new ProviderRelationshipsDbContext(new DbContextOptionsBuilder <ProviderRelationshipsDbContext>().UseInMemoryDatabase(Guid.NewGuid().ToString()).ConfigureWarnings(warnings => warnings.Throw(RelationalEventId.QueryClientEvaluationWarning)).Options);
     ConfigurationProvider = new MapperConfiguration(c => c.AddProfiles(typeof(AccountProviderMappings)));
     AuthorizationService  = new Mock <IAuthorizationService>();
     Handler = new GetAccountProvidersQueryHandler(new Lazy <ProviderRelationshipsDbContext>(() => Db), ConfigurationProvider, AuthorizationService.Object);
 }
Beispiel #2
0
        public async Task <ActionResult> Index(AccountProvidersRouteValues routeValues)
        {
            var query  = new GetAccountProvidersQuery(routeValues.AccountId.Value);
            var result = await _mediator.Send(query);

            var model = _mapper.Map <AccountProvidersViewModel>(result);

            return(View(model));
        }