Ejemplo n.º 1
0
 public UserManagementService(IUnitOfWork unitOfWork, IFileService fileService,
                              IConfirmationService confirmation)
 {
     _unitOfWork   = unitOfWork;
     _fileService  = fileService;
     _confirmation = confirmation;
 }
Ejemplo n.º 2
0
        public UserManager(
            IUserRepository userRepository,
            IConfirmationService confirmationService,
            PaginationSettings paginationSettings,
            IProjectMembershipRepostiory projectMembershipRepostiory,
            IMailer mailer,
            ApplicationLocationSettings applicationLocationSettings,
            IPasswordManager passwordManager,
            IEventBus eventBus)
        {
            Require.NotNull(userRepository, nameof(userRepository));
            Require.NotNull(confirmationService, nameof(confirmationService));
            Require.NotNull(paginationSettings, nameof(paginationSettings));
            Require.NotNull(projectMembershipRepostiory, nameof(projectMembershipRepostiory));
            Require.NotNull(mailer, nameof(mailer));
            Require.NotNull(applicationLocationSettings, nameof(applicationLocationSettings));
            Require.NotNull(passwordManager, nameof(passwordManager));
            Require.NotNull(eventBus, nameof(eventBus));

            _userRepository              = userRepository;
            _confirmationService         = confirmationService;
            _paginationSettings          = paginationSettings;
            _projectMembershipRepostiory = projectMembershipRepostiory;
            _mailer = mailer;
            _applicationLocationSettings = applicationLocationSettings;
            _passwordManager             = passwordManager;
            _eventBus = eventBus;
        }
 public CreatePasswordCommandHandler(IAccountRepository repository, IPasswordHasher hasher,
                                     IConfirmationService confirmation)
 {
     _repository   = repository;
     _hasher       = hasher;
     _confirmation = confirmation;
 }
 public SendConfirmationCommandHandler(IConfirmationService confirmation, IKafkaMessageBus bus,
                                       IEmailBuilder emailBuilder)
 {
     _confirmation = confirmation;
     _bus          = bus;
     _emailBuilder = emailBuilder;
 }
Ejemplo n.º 5
0
        public void MyTestInitialize()
        {
            this.mockRepository = new MockRepository();

            this.productRepositoryStub  = mockRepository.Stub <IProductRepository>();
            this.calculationServiceStub = mockRepository.Stub <IOrderCalculationService>();

            this.customerStub         = MockRepository.GenerateStub <ICustomer>();
            this.customerStub.Name    = "CustomerName";
            this.customerStub.Address = "CustomerAddress";

            this.productStub             = MockRepository.GenerateStub <IProduct>();
            this.productStub.Name        = "ProductName";
            this.productStub.Description = "ProductDescription";
            this.productStub.Price       = 10;

            this.productRepositoryMock     = mockRepository.DynamicMock <IProductRepository>();
            this.orderRepositoryMock       = mockRepository.DynamicMock <IOrderRepository>();
            this.orderAmountCalculatorMock = mockRepository.DynamicMock <IOrderCalculationService>();
            this.confirmationServiceMock   = mockRepository.DynamicMock <IConfirmationService>();

            this.productSelectedByCustomer = "ProductName";
            this.quantity = 100;

            this.orderAmount = 1000;
        }
Ejemplo n.º 6
0
        public IntegrationTests()
        {
            _directoryPathProviderMock = Substitute.For <IDirectoryPathProvider>();
            _newImageDataProviderMock  = Substitute.For <INewImageDataProvider>();
            _confirmationServiceMock   = Substitute.For <IConfirmationService>();

            _errorHandlerMock = Substitute.For <IErrorHandler>();
            _errorHandlerMock.WhenForAnyArgs(x => x.ShowError(default)).Do(x => throw x.ArgAt <Exception>(0));
Ejemplo n.º 7
0
 public ConfirmationType(IConfirmationService confirmationService)
 {
     Field(m => m.Id).Name("Id").Description("ConfirmationId");
     Field(m => m.Name).Name("Name").Description("Confirmation Name");
     Field(m => m.Description).Name("Description").Description("Confirmation Description");
     Field(m => m.SortOrder).Name("SortOrder").Description("Confirmation Sort Order");
     Field(m => m.IsDeleted).Name("IsDeleted").Description("Confirmation Is Deleted");
 }
Ejemplo n.º 8
0
 public SummaryService(IEnumerable <ISummaryFromAirlineService <TConfirmation> > summaryFromAirlineServices,
                       IncorrectConfirmationTemplateSpecyfication <TConfirmation> specyfication,
                       IConfirmationService <TConfirmation> confirmationService)
 {
     this.summaryFromAirlineServices = summaryFromAirlineServices;
     this.specyfication       = specyfication;
     this.confirmationService = confirmationService;
 }
 public OrderConfirmationController(
     //ICampaignService campaignService,
     IConfirmationService confirmationService,
     IAddressBookService addressBookService,
     IOrderGroupCalculator orderGroupCalculator,
     UrlResolver urlResolver, ICustomerService customerService) :
     base(confirmationService, addressBookService, orderGroupCalculator, urlResolver, customerService)
 {
     //_campaignService = campaignService;
 }
Ejemplo n.º 10
0
 public AdminController(
     IConfirmationService confirmationService, 
     NotificationEventSink notificationEventSink, 
     IUserManager userManager)
 {
     Require.NotNull(confirmationService, nameof(confirmationService));
     _confirmationService = confirmationService;
     _notificationEventSink = notificationEventSink;
     _userManager = userManager;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderService"/> class.
 /// </summary>
 /// <param name="productRepository">The product repository.</param>
 /// <param name="orderRepository">The order repository.</param>
 /// <param name="amountCalculator">The amount calculator.</param>
 /// <param name="confirmationService">The confirmation service.</param>
 public OrderService(
     IProductRepository productRepository,
     IOrderRepository orderRepository,
     IOrderCalculationService amountCalculator,
     IConfirmationService confirmationService)
 {
     this.producRepository        = productRepository;
     this.orderRepository         = orderRepository;
     this.orderCalculationService = amountCalculator;
     this.confirmationService     = confirmationService;
 }
Ejemplo n.º 12
0
 public ManageController(ICustomerRequestServices customerRequestServices, IRoomTypeServices roomTypeServices,
                         ICustomerRequestStatusService customerRequestStatusService, IConfirmationService confirmationService,
                         IRoomService roomService, IBookingService bookingService)
 {
     _customerRequestServices      = customerRequestServices;
     _roomTypeServices             = roomTypeServices;
     _customerRequestStatusService = customerRequestStatusService;
     _confirmationService          = confirmationService;
     _roomService    = roomService;
     _bookingService = bookingService;
 }
Ejemplo n.º 13
0
 public OrderConfirmationMailController(IConfirmationService confirmationService,
                                        IAddressBookService addressBookService,
                                        ICustomerService customerService,
                                        IOrderGroupCalculator orderGroupCalculator,
                                        IContextModeResolver contextModeResolver)
 {
     _confirmationService  = confirmationService;
     _addressBookService   = addressBookService;
     _customerService      = customerService;
     _orderGroupCalculator = orderGroupCalculator;
     _contextModeResolver  = contextModeResolver;
 }
Ejemplo n.º 14
0
 protected OrderConfirmationControllerBase(IConfirmationService confirmationService,
                                           IAddressBookService addressBookService,
                                           IOrderGroupCalculator orderGroupTotalsCalculator,
                                           UrlResolver urlResolver,
                                           ICustomerService customerService)
 {
     _confirmationService  = confirmationService;
     _addressBookService   = addressBookService;
     _orderGroupCalculator = orderGroupTotalsCalculator;
     _urlResolver          = urlResolver;
     _customerService      = customerService;
 }
Ejemplo n.º 15
0
 public ImageViewerViewModel(
     IGalleryManager unsamplesDirectoryOpener,
     IDirectoryPathProvider directoryPathProvider,
     IErrorHandler errorHandler,
     IConfirmationService confirmationService,
     INewImageDataProvider newImageDataProvider)
 {
     _galleryManager        = unsamplesDirectoryOpener;
     _directoryPathProvider = directoryPathProvider;
     _errorHandler          = errorHandler;
     _confirmationService   = confirmationService;
     _newImageDataProvider  = newImageDataProvider;
 }
Ejemplo n.º 16
0
        public GameCopiesViewModel(GameModel model)
        {
            Id     = model.Id;
            Copies = new ObservableCollection <CopyModel>();
            Game   = model;

            LoadCopiesCommand = new Command(async() => await LoadCopies());
            EditCopyCommand   = new Command <CopyModel>(async(m) => await EditCopy(m));
            DeleteCopyCommand = new Command <CopyModel>(async(m) => await DeleteCopy(m));

            ConfirmationService = DependencyService.Get <IConfirmationService>();

            _api = DependencyService.Get <APIActionService>();
        }
Ejemplo n.º 17
0
 public TaskType(ITaskService taskService, IJobService jobService, IConfirmationService confirmationService)
 {
     Field(m => m.Id);
     Field <JobType, JobDto>().Name("Job")
     .ResolveAsync(ctx => { return(jobService.GetJobByIdAsync(ctx.Source.JobId)); });
     Field <ConfirmationType, ConfirmationDto>().Name("Confirmation")
     .ResolveAsync(ctx => { return(confirmationService.GetConfirmationByIdAsync(ctx.Source.ConfirmationId)); });
     Field(m => m.Description);
     Field(m => m.HelpText);
     Field(m => m.IsDeleted);
     Field(m => m.SortOrder);
     Field(m => m.IsComplete);
     Field(m => m.CompletedBy);
     Field(m => m.CompletedDate, nullable: false, type: typeof(DateGraphType));
 }
Ejemplo n.º 18
0
        public UserManager(
            IUserRepository userRepository,
            IConfirmationService confirmationService, PaginationSettings paginationSettings, IProjectMembershipRepostiory projectMembershipRepostiory, IMailer mailer, ApplicationLocationSettings applicationLocationSettings, IPasswordManager passwordManager)
        {
            Require.NotNull(userRepository, nameof(userRepository));
            Require.NotNull(confirmationService, nameof(confirmationService));

            _userRepository = userRepository;
            _confirmationService = confirmationService;
            _paginationSettings = paginationSettings;
            _projectMembershipRepostiory = projectMembershipRepostiory;
            _mailer = mailer;
            _applicationLocationSettings = applicationLocationSettings;
            _passwordManager = passwordManager;
        }
Ejemplo n.º 19
0
        public ImageViewerViewModelTests()
        {
            _galleryManager            = Substitute.For <IGalleryManager>();
            _directoryPathProviderMock = Substitute.For <IDirectoryPathProvider>();
            _errorHandlerMock          = Substitute.For <IErrorHandler>();
            _confirmationServiceMock   = Substitute.For <IConfirmationService>();
            _newImageDataProvider      = Substitute.For <INewImageDataProvider>();

            _viewModel = Substitute.ForPartsOf <ImageViewerViewModel>(
                _galleryManager,
                _directoryPathProviderMock,
                _errorHandlerMock,
                _confirmationServiceMock,
                _newImageDataProvider);
        }
Ejemplo n.º 20
0
        public AdminController(
            IConfirmationService confirmationService,
            NotificationEventSink notificationEventSink,
            IUserManager userManager,
            IEventBus eventBus)
        {
            Require.NotNull(confirmationService, nameof(confirmationService));
            Require.NotNull(notificationEventSink, nameof(notificationEventSink));
            Require.NotNull(userManager, nameof(userManager));
            Require.NotNull(eventBus, nameof(eventBus));

            _confirmationService   = confirmationService;
            _notificationEventSink = notificationEventSink;
            _userManager           = userManager;
            _eventBus = eventBus;
        }
        public CreatePasswordCommandValidator(IConfirmationService confirmation, IPasswordValidator validator)
        {
            RuleFor(x => x)
            .CustomAsync(async(command, context, ct) =>
            {
                var data = await confirmation.GetAsync(command.ConfirmationId, ct);
                if (data is null)
                {
                    context.AddFailure(
                        new ValidationFailure(nameof(CreatePasswordCommand.ConfirmationCode), "Not found")
                    {
                        ErrorCode = ElwarkExceptionCodes.ConfirmationNotFound
                    });

                    return;
                }

                if (data.Code != command.ConfirmationCode)
                {
                    context.AddFailure(
                        new ValidationFailure(nameof(CreatePasswordCommand.ConfirmationCode), "Not match")
                    {
                        ErrorCode = ElwarkExceptionCodes.ConfirmationNotMatch
                    });
                }
            });

            RuleFor(x => x.Password)
            .NotEmpty()
            .CustomAsync(async(password, context, token) =>
            {
                var(isSuccess, error) = await validator.ValidateAsync(password, token);
                if (!isSuccess)
                {
                    context.AddFailure(
                        new ValidationFailure(nameof(SignUpByEmailCommand.Password), "Incorrect password")
                    {
                        ErrorCode = error
                    }
                        );
                }
            });
        }
Ejemplo n.º 22
0
        public DevelopersController(
            IUserManager userManager,
            DevelopersMapper mapper,
            IConfirmationService confirmationService,
            IUserPresentationProvider userPresentationProvider, IPaginationWrapper <Account> paginationWrapper,
            IPasswordManager passwordManager)
        {
            Require.NotNull(userManager, nameof(userManager));
            Require.NotNull(mapper, nameof(mapper));
            Require.NotNull(confirmationService, nameof(confirmationService));
            Require.NotNull(userPresentationProvider, nameof(userPresentationProvider));

            _userManager              = userManager;
            _mapper                   = mapper;
            _confirmationService      = confirmationService;
            _userPresentationProvider = userPresentationProvider;
            _paginationWrapper        = paginationWrapper;
            _passwordManager          = passwordManager;
        }
        public DevelopersController(
            IUserManager userManager,
            DevelopersMapper mapper,
            IConfirmationService confirmationService,
            IUserPresentationProvider userPresentationProvider, IPaginationWrapper<Account> paginationWrapper,
            IPasswordManager passwordManager)
        {
            Require.NotNull(userManager, nameof(userManager));
            Require.NotNull(mapper, nameof(mapper));
            Require.NotNull(confirmationService, nameof(confirmationService));
            Require.NotNull(userPresentationProvider, nameof(userPresentationProvider));

            _userManager = userManager;
            _mapper = mapper;
            _confirmationService = confirmationService;
            _userPresentationProvider = userPresentationProvider;
            _paginationWrapper = paginationWrapper;
            _passwordManager = passwordManager;
        }
Ejemplo n.º 24
0
 public OrderHistoryController(IAddressBookService addressBookService,
                               IOrderRepository orderRepository,
                               IConfirmationService confirmationService,
                               ICartService cartService,
                               IOrderGroupCalculator orderGroupCalculator,
                               IContentLoader contentLoader,
                               UrlResolver urlResolver, IOrderGroupFactory orderGroupFactory, ICustomerService customerService,
                               PaymentMethodViewModelFactory paymentMethodViewModelFactory,
                               ICookieService cookieService,
                               ISettingsService settingsService) :
     base(confirmationService, addressBookService, orderGroupCalculator, urlResolver, customerService)
 {
     _addressBookService            = addressBookService;
     _orderRepository               = orderRepository;
     _contentLoader                 = contentLoader;
     _cartService                   = cartService;
     _orderGroupFactory             = orderGroupFactory;
     _paymentMethodViewModelFactory = paymentMethodViewModelFactory;
     _cookieService                 = cookieService;
     _settingsService               = settingsService;
 }
Ejemplo n.º 25
0
        public GalleryImageSelectorTests()
        {
            _galleryManager            = Substitute.For <IGalleryManager>();
            _directoryPathProviderMock = Substitute.For <IDirectoryPathProvider>();
            _errorHandlerMock          = Substitute.For <IErrorHandler>();
            _confirmationServiceMock   = Substitute.For <IConfirmationService>();
            _newImageDataProvider      = Substitute.For <INewImageDataProvider>();

            _viewModel = new ImageViewerViewModel(
                _galleryManager,
                _directoryPathProviderMock,
                _errorHandlerMock,
                _confirmationServiceMock,
                _newImageDataProvider);

            _testGallery = new ImageGallery("Test name", new List <GalleryImageInfo>
            {
                new GalleryImageInfo("fullname\\name.jpg", true, new CreditsEntry
                {
                    PhotoUrl = "url",
                    UserName = "******",
                    UserUrl  = "userurl",
                }),
                new GalleryImageInfo("fullname\\name1.jpg", true, new CreditsEntry
                {
                    PhotoUrl = "url1",
                    UserName = "******",
                    UserUrl  = "userurl1",
                }),
                new GalleryImageInfo("fullname\\name2.jpg", true, new CreditsEntry
                {
                    PhotoUrl = "url2",
                    UserName = "******",
                    UserUrl  = "userurl2",
                }),
            });

            _galleryManager.OpenGallery(Arg.Any <string>()).Returns(_testGallery);
            _viewModel.OpenGallery();
        }
Ejemplo n.º 26
0
 public void SetUp()
 {
     confirmations = new List <Confirmation>
     {
         new Confirmation
         {
             Id                = 0,
             RoomId            = 0,
             CustomerRequestId = 0
         },
         new Confirmation
         {
             Id                = 1,
             RoomId            = 1,
             CustomerRequestId = 1
         },
         new Confirmation
         {
             Id                = 2,
             RoomId            = 1,
             CustomerRequestId = 1
         },
         new Confirmation
         {
             Id                = 3,
             RoomId            = 1,
             CustomerRequestId = 1
         }
     };
     // Create a new mock of the repository
     _confirmationRepository = new Mock <IRepository <Confirmation> >();
     _unitOfWork             = new Mock <IUnitOfWork>();
     // Set up the mock for the repository
     _unitOfWork.Setup(x => x.Confirmations.GetAll()).Returns(confirmations);
     _confirmationRepository.Setup(x => x.GetAll())
     .Returns(confirmations);
     // Create the service and inject the repository into the service
     _confirmationService = new ConfirmationService(_unitOfWork.Object);
 }
Ejemplo n.º 27
0
 public ConfirmController(ISessionData sessionData, IConfirmationService confirmationService)
     : base(sessionData)
 {
     _confirmationService = confirmationService;
 }
Ejemplo n.º 28
0
 public AccountController(IAuthenticateService authService, IUserManagementService userManagement, IConfirmationService confirmation)
 {
     _authService    = authService;
     _userManagement = userManagement;
     _confirmation   = confirmation;
 }
 public ServiceInjectionCallAndReturnViewModel(IConfirmationService confirmationService)
 {
     _confirmationService        = confirmationService;
     ExecuteSomeOperationCommand = new Command(DoSomething);
 }
Ejemplo n.º 30
0
 public ConfirmController(ISessionData sessionData, IConfirmationService confirmationService)
     : base(sessionData) {
     _confirmationService = confirmationService;
 }
 public ConfirmIdentityCommandValidator(IConfirmationService confirmation) =>
Ejemplo n.º 32
0
        public CheckmateQuery(IUsersService users, IRoleService roles, IUserRoleService userRoles, IImageService images, IJobService jobs,
                              INotificationService notifications, IPriorityService priorities,
                              INotificationUserService notificationUsers, IScheduleService schedules, ITaskService tasks, ITaskResultService taskResults, IConfirmationService confirmations,
                              IEntityTypeService entityTypes,
                              ICategoryService categories,
                              IFrequencyService frequencies)
        {
            Field <ListGraphType <UserType> >(
                Name        = "Users",
                Description = "Get the list of Users",
                resolve: context => users.GetUsersAsync());

            Field <UserType>(
                Name        = "User",
                Description = "Get a particular User with a given UserId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name = "id", Description = "Id of the user"
            }),
                resolve: context => users.GetUserByIdAsync(context.GetArgument <string>("id")));

            Field <ListGraphType <RoleType> >("Roles", resolve: context => roles.GetRolesAsync());

            Field <RoleType>(
                Name        = "Role",
                Description = "Get a particular Role with a given RoleId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the role"
            }),
                resolve: context => roles.GetRoleById(context.GetArgument <string>("id")));

            Field <ListGraphType <UserRoleType>, IEnumerable <UserRole> >().Name("UserRoles").Description("Get the list of UserRoles")
            .ResolveAsync(ctx => userRoles.GetUserRolesAsync());

            Field <ListGraphType <ImageType> >(
                Name        = "Images",
                Description = "Get the list of Images",
                resolve: context => images.GetImagesAsync());

            Field <ImageType>(
                Name        = "Image",
                Description = "Get a particular Image with a given ImageId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the image"
            }),
                resolve: context => images.GetImageByIdAsync(context.GetArgument <int>("id")));

            Field <ListGraphType <JobType> >(
                Name        = "Jobs",
                Description = "Get the list of Jobs",
                resolve: context => jobs.GetJobsAsync());

            Field <JobType>(
                Name        = "Job",
                Description = "Get a particular Job with a given JobId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the job"
            }),
                resolve: context => jobs.GetJobByIdAsync(context.GetArgument <long>("id")));

            Field <ListGraphType <NotificationType> >(
                Name        = "Notifications",
                Description = "Get the list of Notifications",
                resolve: context => notifications.GetNotificationsAsync());

            Field <NotificationType>(
                Name        = "Notification",
                Description = "Get a particular Notification with a given NotificationId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the notification"
            }),
                resolve: context => notifications.GetNotificationByIdAsync(context.GetArgument <long>("id")));

            Field <ListGraphType <PriorityType> >(
                Name        = "Priorities",
                Description = "Gets the list of Priorities",
                resolve: context => priorities.GetPrioritiesAsync());

            Field <PriorityType>(
                Name        = "Priority",
                Description = "Get a particular Priority with a given PriorityId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the priority"
            }),
                resolve: context => priorities.GetPriorityByIdAsync(context.GetArgument <short>("id")));

            Field <ListGraphType <NotificationUserType>, IEnumerable <NotificationUser> >().Name("NotificationUsers")
            .ResolveAsync(ctx => notificationUsers.GetNotificationUsersAsync());

            Field <ListGraphType <ScheduleType> >(
                Name        = "Schedules",
                Description = "Gets the list of Schedules",
                resolve: context => schedules.GetSchedulesAsync());

            Field <ConfirmationType>(
                Name        = "Schedule",
                Description = "Get a particular Schedule with a given ScheduleId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the schedule"
            }),
                resolve: context => schedules.GetScheduleByIdAsync(context.GetArgument <long>("id")));

            Field <ListGraphType <TaskResultType> >(
                Name        = "TaskResults",
                Description = "Gets the list of TaskResults",
                resolve: context => taskResults.GetTaskResultsAsync());

            Field <TaskResultType>(
                Name        = "TaskResult",
                Description = "Get a particular TaskResult with a given TaskResultId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the task"
            }),
                resolve: context => taskResults.GetTaskResultByIdAsync(context.GetArgument <long>("id")));

            Field <ListGraphType <TaskType> >(
                Name        = "Tasks",
                Description = "Gets the list of Tasks",
                resolve: context => tasks.GetTasksAsync());

            Field <TaskType>(
                Name        = "Task",
                Description = "Get a particular Task with a given TaskId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the task"
            }),
                resolve: context => tasks.GetTaskByIdAsync(context.GetArgument <long>("id")));


            Field <ListGraphType <FrequencyType> >(
                Name        = "Frequencies",
                Description = "Gets the list of Frequencies",
                resolve: context => frequencies.GetFrequenciesAsync());

            Field <FrequencyType>(
                Name        = "Frequency",
                Description = "Get a particular Frequency with a given FrequencyId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the frequency"
            }),
                resolve: context => frequencies.GetFrequencyIdAsync(context.GetArgument <int>("id")));

            Field <ListGraphType <EntityTypeType> >(
                Name        = "EntityTypes",
                Description = "Gets the list of EntityTypes",
                resolve: context => entityTypes.GetEntityTypesAsync());

            Field <EntityTypeType>(
                Name        = "EntityType",
                Description = "Get a particular EntityType with a given EntityTypeId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the entity type"
            }),
                resolve: context => entityTypes.GetEntityTypeIdAsync(context.GetArgument <int>("id")));

            Field <ListGraphType <CategoryType> >(
                Name        = "Categories",
                Description = "Gets the list of Categories",
                resolve: context => categories.GetCategoriesAsync());

            Field <CategoryType>(
                Name        = "Category",
                Description = "Get a particular Category with a given CategoryId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the category"
            }),
                resolve: context => categories.GetCategoryIdAsync(context.GetArgument <int>("id")));

            Field <ListGraphType <ConfirmationType> >(
                Name        = "Confirmations",
                Description = "Gets the list of Confirmations",
                resolve: context => confirmations.GetConfirmationsAsync());

            Field <ConfirmationType>(
                Name        = "Confirmation",
                Description = "Get a particular Confirmation with a given ConfirmationId",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> >
            {
                Name        = "id",
                Description = "Id of the confirmation"
            }),
                resolve: context => confirmations.GetConfirmationByIdAsync(context.GetArgument <short>("id")));
        }
Ejemplo n.º 33
0
 public ConfirmationController(IConfirmationService confirmationService)
 {
     this.confirmationService = confirmationService;
 }
 public ConfirmIdentityCommandHandler(IAccountRepository repository, IConfirmationService confirmation)
 {
     _repository   = repository;
     _confirmation = confirmation;
 }